Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: fix fallback key encryption

Ammar Ahmed2cd4f44a9266
diff --git a/packages/core/src/api/user-manager.ts b/packages/core/src/api/user-manager.ts
index 87eeabee4..2384ea033 100644
--- a/packages/core/src/api/user-manager.ts
+++ b/packages/core/src/api/user-manager.ts
@@ -150,7 +150,7 @@ class UserManager {
token.access_token
)
.catch(async (e) => {
- if (e instanceof Error && e.message === "invalid_grant") {
+ if (e instanceof Error && e.message === "Password is incorrect.") {
hashedPassword = await this.db
.storage()
.hash(password, email, { usesFallback: true });
@@ -580,6 +580,7 @@ class UserManager {
},
token
);
+ await this.db.kv().write("usesFallbackPWHash", false);
return true;
}