core: fix fallback key encryption

This commit is contained in:
Ammar Ahmed
2024-12-13 14:06:17 +05:00
committed by Ammar Ahmed
parent 4b9a95ded7
commit 2cd4f44a92

View File

@@ -150,7 +150,7 @@ class UserManager {
token.access_token token.access_token
) )
.catch(async (e) => { .catch(async (e) => {
if (e instanceof Error && e.message === "invalid_grant") { if (e instanceof Error && e.message === "Password is incorrect.") {
hashedPassword = await this.db hashedPassword = await this.db
.storage() .storage()
.hash(password, email, { usesFallback: true }); .hash(password, email, { usesFallback: true });
@@ -580,6 +580,7 @@ class UserManager {
}, },
token token
); );
await this.db.kv().write("usesFallbackPWHash", false);
return true; return true;
} }