Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Throw error if vault version is unknown (newer) during login (#957)

Leendert de Borstc0c1b75e739f
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/Login.tsx b/apps/browser-extension/src/entrypoints/popup/pages/Login.tsx
index 132b1b493..b6197acbe 100644
--- a/apps/browser-extension/src/entrypoints/popup/pages/Login.tsx
+++ b/apps/browser-extension/src/entrypoints/popup/pages/Login.tsx
@@ -163,10 +163,14 @@ const Login: React.FC = () => {
await authContext.login();
// If there are pending migrations, redirect to the upgrade page.
- if (await sqliteClient.hasPendingMigrations()) {
- navigate('/upgrade', { replace: true });
- hideLoading();
- return;
+ try {
+ if (await sqliteClient.hasPendingMigrations()) {
+ navigate('/upgrade', { replace: true });
+ hideLoading();
+ return;
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'An error occurred while checking for pending migrations.');
}
// Navigate to reinitialize page which will take care of the proper redirect.
@@ -240,9 +244,14 @@ const Login: React.FC = () => {
await authContext.login();
// If there are pending migrations, redirect to the upgrade page.
- if (await sqliteClient.hasPendingMigrations()) {
- navigate('/upgrade', { replace: true });
- return;
+ try {
+ if (await sqliteClient.hasPendingMigrations()) {
+ navigate('/upgrade', { replace: true });
+ hideLoading();
+ return;
+ }
+ } catch (err) {
+ setError(err instanceof Error ? err.message : 'An error occurred while checking for pending migrations.');
}
// Navigate to reinitialize page which will take care of the proper redirect.
diff --git a/apps/browser-extension/src/utils/SqliteClient.ts b/apps/browser-extension/src/utils/SqliteClient.ts
index 5fe7d7a91..202c573f6 100644
--- a/apps/browser-extension/src/utils/SqliteClient.ts
+++ b/apps/browser-extension/src/utils/SqliteClient.ts
@@ -561,7 +561,7 @@ export class SqliteClient {
const currentVersionRevision = allVersions.find(v => v.version === currentVersion);
if (!currentVersionRevision) {
- throw new Error('This browser extension is outdated and cannot be used to access this vault. Please update this extension to continue.');
+ throw new Error('This browser extension is outdated and cannot be used to access this vault. Please update this browser extension to continue.');
}
return currentVersionRevision;