Merge pull request #402 from Kouthk/patch-2

🧯 Permite ao perfil 'user' trocar a propria senha.
This commit is contained in:
Cassio Santos
2022-03-14 11:19:10 -03:00
committed by GitHub

View File

@@ -68,7 +68,7 @@ export const update = async (
req: Request,
res: Response
): Promise<Response> => {
if (req.user.profile !== "admin") {
if (req.user.profile !== "admin" && sessionUserId !== "user") {
throw new AppError("ERR_NO_PERMISSION", 403);
}