Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

Fix missing redirect in login handler (#63)

Leendert de Borst5d44a3aeffe0
diff --git a/src/AliasVault.WebApp/Auth/Pages/Base/LoginBase.cs b/src/AliasVault.WebApp/Auth/Pages/Base/LoginBase.cs
index 4c75e65e8..79dea2754 100644
--- a/src/AliasVault.WebApp/Auth/Pages/Base/LoginBase.cs
+++ b/src/AliasVault.WebApp/Auth/Pages/Base/LoginBase.cs
@@ -141,9 +141,19 @@ public class LoginBase : OwningComponentBase
// Store the encryption key in memory.
AuthService.StoreEncryptionKey(passwordHash);
- // Redirect to home page.
await AuthStateProvider.GetAuthenticationStateAsync();
GlobalNotificationService.ClearMessages();
- NavigationManager.NavigateTo("/");
+
+ // Redirect to the page the user was trying to access before if set.
+ var localStorageReturnUrl = await LocalStorage.GetItemAsync<string>("returnUrl");
+ if (!string.IsNullOrEmpty(localStorageReturnUrl))
+ {
+ await LocalStorage.RemoveItemAsync("returnUrl");
+ NavigationManager.NavigateTo(localStorageReturnUrl);
+ }
+ else
+ {
+ NavigationManager.NavigateTo("/");
+ }
}
}
diff --git a/src/Tests/AliasVault.E2ETests/Common/TestDefaults.cs b/src/Tests/AliasVault.E2ETests/Common/TestDefaults.cs
index bcce9a641..54b4d5b0e 100644
--- a/src/Tests/AliasVault.E2ETests/Common/TestDefaults.cs
+++ b/src/Tests/AliasVault.E2ETests/Common/TestDefaults.cs
@@ -15,5 +15,5 @@ public static class TestDefaults
/// <summary>
/// Gets or sets default timeout while waiting for pages to load in milliseconds.
/// </summary>
- public static int DefaultTimeout { get; set; } = 15000;
+ public static int DefaultTimeout { get; set; } = 30000;
}