Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Update password change logic to use srpIdentity from server (#1911)
Leendert de Borst4a7ed739f209
diff --git a/apps/mobile-app/hooks/useVaultMutate.ts b/apps/mobile-app/hooks/useVaultMutate.tsindex d30dccec4..8ba5ac85d 100644--- a/apps/mobile-app/hooks/useVaultMutate.ts+++ b/apps/mobile-app/hooks/useVaultMutate.ts@@ -185,12 +185,14 @@ export function useVaultMutate() : {throw new Error(t('common.errors.unknownError'));}- const privateKey = await NativeVaultManager.srpDerivePrivateKey(currentSalt, username, currentPasswordHashString);+ // Use srpIdentity from server response if available, otherwise fall back to username.+ const srpIdentity = data.srpIdentity ?? username;+ const privateKey = await NativeVaultManager.srpDerivePrivateKey(currentSalt, srpIdentity, currentPasswordHashString);const newClientSession = await NativeVaultManager.srpDeriveSession(newClientEphemeral.secret,currentServerEphemeral,currentSalt,- username,+ srpIdentity,privateKey);@@ -226,7 +228,7 @@ export function useVaultMutate() : {}// Generate SRP password change data using native SRP- const newPrivateKey = await NativeVaultManager.srpDerivePrivateKey(newSalt, username, newPasswordHashString);+ const newPrivateKey = await NativeVaultManager.srpDerivePrivateKey(newSalt, srpIdentity, newPasswordHashString);const newVerifier = await NativeVaultManager.srpDeriveVerifier(newPrivateKey);// Prepare vault for password change