diff --git a/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx b/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx index c3a062a8b..ebcc51b60 100644 --- a/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx +++ b/apps/mobile-app/app/(tabs)/settings/security/delete-account.tsx @@ -154,7 +154,12 @@ export default function DeleteAccountScreen(): React.ReactNode { const data = await webApi.post('Auth/delete-account/initiate', deleteAccountInitiateRequest); const currentSalt = data.salt; const currentServerEphemeral = data.serverEphemeral; - const srpIdentity = data.srpIdentity; + + /** + * Use srpIdentity from server response if available, otherwise fall back to username. + * Note: the fallback can be removed in the future after 0.26.0+ is deployed. + */ + const srpIdentity = data.srpIdentity ?? username; setLoadingStatus(t('settings.securitySettings.deleteAccount.verifyingWithServer')); // Convert base64 string to hex string diff --git a/apps/mobile-app/hooks/useVaultMutate.ts b/apps/mobile-app/hooks/useVaultMutate.ts index 8ba5ac85d..d1f2139dd 100644 --- a/apps/mobile-app/hooks/useVaultMutate.ts +++ b/apps/mobile-app/hooks/useVaultMutate.ts @@ -185,7 +185,10 @@ export function useVaultMutate() : { throw new Error(t('common.errors.unknownError')); } - // Use srpIdentity from server response if available, otherwise fall back to username. + /** + * Use srpIdentity from server response if available, otherwise fall back to username. + * Note: the fallback can be removed in the future after 0.26.0+ is deployed. + */ const srpIdentity = data.srpIdentity ?? username; const privateKey = await NativeVaultManager.srpDerivePrivateKey(currentSalt, srpIdentity, currentPasswordHashString); const newClientSession = await NativeVaultManager.srpDeriveSession(