mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: disable 2FA on reset password (#550)
This commit is contained in:
1 parent
10d742fe62
commit
317beeac8d
1 file changed
+1
@@ -384,6 +384,7 @@ class UserLostPassWithCodeHandler extends Handler {
|
||||
const tdoc = await token.get(code, token.TYPE_LOSTPASS);
|
||||
if (!tdoc) throw new InvalidTokenError(token.TYPE_TEXTS[token.TYPE_LOSTPASS], code);
|
||||
if (password !== verifyPassword) throw new VerifyPasswordError();
|
||||
await user.setById(tdoc.uid, { authenticators: [], tfa: false });
|
||||
await user.setPassword(tdoc.uid, password);
|
||||
await token.del(code, token.TYPE_LOSTPASS);
|
||||
this.response.redirect = this.url('homepage');
|
||||
|
||||
Reference in new issue
Block a user