Skip to content

Commit

Permalink
change: requerir senha somente se tiver ao editar perfil
Browse files Browse the repository at this point in the history
  • Loading branch information
julio-ufpb committed Dec 13, 2023
1 parent a23a035 commit 02cca01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/ManageProfile/ManageProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/types/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type User = {
ownerOfSession: boolean;
needProfile: boolean;
accessLevel?: UserAccessLevel;
hasPassword?: boolean;
}

export const UserAccessLevelLabel: { [k in UserAccessLevel]: string } = {
Expand Down

0 comments on commit 02cca01

Please sign in to comment.