update password update

This commit is contained in:
pilcrowOnPaper 2024-10-06 16:38:20 +09:00
parent 62b7bb2a44
commit 76276f5fb6

View file

@ -68,13 +68,6 @@ async function updatePasswordAction(event: RequestEvent) {
} }
}); });
} }
if (!event.locals.user.emailVerified) {
return fail(403, {
password: {
message: "Forbidden"
}
});
}
if (event.locals.user.registered2FA && !event.locals.session.twoFactorVerified) { if (event.locals.user.registered2FA && !event.locals.session.twoFactorVerified) {
return fail(403, { return fail(403, {
password: { password: {
@ -125,6 +118,7 @@ async function updatePasswordAction(event: RequestEvent) {
} }
}); });
} }
passwordUpdateBucket.reset(event.locals.session.id);
invalidateUserSessions(event.locals.user.id); invalidateUserSessions(event.locals.user.id);
await updateUserPassword(event.locals.user.id, newPassword); await updateUserPassword(event.locals.user.id, newPassword);