diff --git a/src/AliasVault.WebApp/Auth/Pages/Register.razor b/src/AliasVault.WebApp/Auth/Pages/Register.razor index 756e39a3d..58820d7de 100644 --- a/src/AliasVault.WebApp/Auth/Pages/Register.razor +++ b/src/AliasVault.WebApp/Auth/Pages/Register.razor @@ -86,6 +86,9 @@ if (tokenObject != null) { + // Store the encryption key in memory. + AuthService.StoreEncryptionKey(passwordHash); + // Store the token as a plain string in local storage await AuthService.StoreAccessTokenAsync(tokenObject.Token); await AuthService.StoreRefreshTokenAsync(tokenObject.RefreshToken); diff --git a/src/AliasVault.WebApp/Auth/Pages/Unlock.razor b/src/AliasVault.WebApp/Auth/Pages/Unlock.razor index e429fe3ab..34ab03a28 100644 --- a/src/AliasVault.WebApp/Auth/Pages/Unlock.razor +++ b/src/AliasVault.WebApp/Auth/Pages/Unlock.razor @@ -135,6 +135,11 @@ // 5. Client verifies proof. Srp.VerifySession(clientEphemeral.Public, clientSession, validateLoginResponse.ServerSessionProof); + + // Store the changed access/refresh tokens in local storage. + await AuthService.StoreAccessTokenAsync(validateLoginResponse.Token.Token); + await AuthService.StoreRefreshTokenAsync(validateLoginResponse.Token.RefreshToken); + // Store the encryption key in memory. AuthService.StoreEncryptionKey(passwordHash);