diff --git a/src/pages/ManageProfile/ManageProfile.tsx b/src/pages/ManageProfile/ManageProfile.tsx index b645f765..345cc41c 100644 --- a/src/pages/ManageProfile/ManageProfile.tsx +++ b/src/pages/ManageProfile/ManageProfile.tsx @@ -109,7 +109,8 @@ export function ManageProfilePage() { } } - const { value: password, isConfirmed } = await SwalUtils.fireModal({ + let hasPassword = authContext.user?.hasPassword ?? false; + const { value: password, isConfirmed } = !hasPassword ? {value: null, isConfirmed: true} : await SwalUtils.fireModal({ title: "Edição de perfil", input: "password", inputLabel: "Inserir senha para salvar as alterações", diff --git a/src/types/User.ts b/src/types/User.ts index 9a2d4650..f6508f2b 100644 --- a/src/types/User.ts +++ b/src/types/User.ts @@ -7,6 +7,7 @@ export type User = { ownerOfSession: boolean; needProfile: boolean; accessLevel?: UserAccessLevel; + hasPassword?: boolean; } export const UserAccessLevelLabel: { [k in UserAccessLevel]: string } = {