mirror of
https://github.com/aliasvault/aliasvault.git
synced 2026-05-19 13:57:18 -04:00
Update password change logic to use srpIdentity from server (#1911)
This commit is contained in:
committed by
Leendert de Borst
parent
84042eeba0
commit
4a7ed739f2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user