Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update login parameter names
Leendert de Borst5f637fcae48d
diff --git a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsxindex 6a858ebd7..5a21b6954 100644--- a/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx+++ b/apps/browser-extension/src/entrypoints/popup/pages/auth/Login.tsx@@ -163,18 +163,18 @@ const Login: React.FC = () => {};/**- * Finish a mobile login: store the tokens and unlock key, then pull and load the vault.+ * Finish a mobile login: store the tokens and the Account Key, then pull and load the vault.* @param username - the normalized username* @param token - the access token* @param refreshToken - the refresh token- * @param unlockKey - the key the phone sent (its Account Key, or an unlock key from an older app), base64+ * @param accountKeyFromMobile - the Account Key the phone sent, base64* @param derivationParams - how the unlock key is derived from the password*/const handleSuccessfulAuth = async (username: string,token: string,refreshToken: string,- unlockKey: string,+ accountKeyFromMobile: string,derivationParams: UnlockKeyDerivationParams) : Promise<void> => {// Store auth info first; the vault fetch below makes an authenticated request via the stored access token.@@ -186,7 +186,7 @@ const Login: React.FC = () => {*/let accountKey: string;try {- accountKey = await VaultKeyService.refreshKeyChain({ unlockKey }, webApi);+ accountKey = await VaultKeyService.refreshKeyChain({ accountKey: accountKeyFromMobile }, webApi);} catch (err) {// If key chain can't be fetched, logout user and show error as this is not a recoverable error.await app.logout();diff --git a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/nativevaultmanager/RustCoreDispatcher.kt b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/nativevaultmanager/RustCoreDispatcher.ktindex 38e9dc00e..699ba39f5 100644--- a/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/nativevaultmanager/RustCoreDispatcher.kt+++ b/apps/mobile-app/android/app/src/main/java/net/aliasvault/app/nativevaultmanager/RustCoreDispatcher.kt@@ -4,6 +4,7 @@ import android.util.Base64import org.json.JSONArrayimport org.json.JSONObjectimport uniffi.aliasvault_core.KeyChainException+import uniffi.aliasvault_core.KeyChainKeysimport uniffi.aliasvault_core.argon2DeriveKeyimport uniffi.aliasvault_core.createAccountKeyHierarchyJsonimport uniffi.aliasvault_core.decodeEmailSource@@ -26,7 +27,6 @@ import uniffi.aliasvault_core.isRelatedOriginAllowedimport uniffi.aliasvault_core.isRpIdAllowedForHostimport uniffi.aliasvault_core.mobileLoginPublicKeyHashimport uniffi.aliasvault_core.mobileLoginVerificationCode-import uniffi.aliasvault_core.KeyChainKeysimport uniffi.aliasvault_core.openKeyChainWithAccountKeyimport uniffi.aliasvault_core.openKeyChainWithUnlockKeyimport uniffi.aliasvault_core.parseEmailSourcediff --git a/apps/web/src/pages/auth/Login.tsx b/apps/web/src/pages/auth/Login.tsxindex 8b570521d..42867baff 100644--- a/apps/web/src/pages/auth/Login.tsx+++ b/apps/web/src/pages/auth/Login.tsx@@ -28,6 +28,7 @@ import { focusWhenVisible } from '@/utils/FocusWhenVisible';import { StorageKeys } from '@/utils/StorageKeys';import type { MobileLoginResult } from '@aliasvault/client/auth/MobileLoginService';+import type { KeyChainKey } from '@aliasvault/client/auth/VaultKeyService';import type { UnlockKeyDerivationParams } from '@aliasvault/models/metadata';import type { LoginResponse, ValidateLoginResponse } from '@aliasvault/models/webapi';@@ -112,16 +113,16 @@ const Login: React.FC = () => {* Store the tokens and the Account Key, then continue to the sync page which loads the vault. A password login also* raises older key derivation settings to the defaults (if applicable).*/- const completeLogin = async (loginUsername: string, accessToken: string, refreshToken: string, unlockKey: string, params: UnlockKeyDerivationParams, loginPassword?: string): Promise<void> => {+ const completeLogin = async (loginUsername: string, accessToken: string, refreshToken: string, key: KeyChainKey, params: UnlockKeyDerivationParams, loginPassword?: string): Promise<void> => {isCompletingLogin.current = true;try {const normalizedUsername = SrpAuthService.normalizeUsername(loginUsername);await auth.setAuthTokens(normalizedUsername, accessToken, refreshToken);// Fetch the key chain, check the unlock key opens it and cache it; without a usable chain the session is useless, so end it.- await UnlockService.completeKeyChainLogin({ unlockKey }, params, webApi, () => auth.logout());- if (loginPassword) {- await UnlockService.upgradeKeyDerivation(loginPassword, params, unlockKey, webApi, normalizedUsername);+ await UnlockService.completeKeyChainLogin(key, params, webApi, () => auth.logout());+ if (loginPassword && 'unlockKey' in key) {+ await UnlockService.upgradeKeyDerivation(loginPassword, params, key.unlockKey, webApi, normalizedUsername);}notifications.clearMessages();@@ -139,7 +140,7 @@ const Login: React.FC = () => {throw new Error(t('auth.loginForm.loginRequestErrorMessage'));}const params = { salt: response.salt, encryptionType: response.encryptionType, encryptionSettings: response.encryptionSettings };- await completeLogin(username, validateLoginResponse.token.token, validateLoginResponse.token.refreshToken, hashBase64, params, password);+ await completeLogin(username, validateLoginResponse.token.token, validateLoginResponse.token.refreshToken, { unlockKey: hashBase64 }, params, password);};/**@@ -152,7 +153,7 @@ const Login: React.FC = () => {try {const params = { salt: result.salt, encryptionType: result.encryptionType, encryptionSettings: result.encryptionSettings };- await completeLogin(result.username, result.token, result.refreshToken, result.accountKey, params);+ await completeLogin(result.username, result.token, result.refreshToken, { accountKey: result.accountKey }, params);} catch (err) {setErrors(await toErrorMessages(err));} finally {