Skip to content

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

Tweak login UI and translations (#1347)

Leendert de Borst7923c16c51d9
diff --git a/apps/server/AliasVault.Client/Auth/Pages/Login.razor b/apps/server/AliasVault.Client/Auth/Pages/Login.razor
index 9bf90fa96..d3f84a98b 100644
--- a/apps/server/AliasVault.Client/Auth/Pages/Login.razor
+++ b/apps/server/AliasVault.Client/Auth/Pages/Login.razor
@@ -113,10 +113,7 @@ else
</div>
<button type="submit" class="w-full px-5 py-3 text-base font-medium text-center text-white bg-primary-700 rounded-lg hover:bg-primary-800 focus:ring-4 focus:ring-primary-300 dark:bg-primary-600 dark:hover:bg-primary-700 dark:focus:ring-primary-800 flex items-center justify-center gap-2">
- <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"></path>
- </svg>
- @Localizer["LoginToAccountButton"]
+ @Localizer["LoginButton"]
</button>
<div class="relative hidden md:block">
@@ -124,7 +121,7 @@ else
<div class="w-full border-t border-gray-300 dark:border-gray-600"></div>
</div>
<div class="relative flex justify-center text-sm">
- <span class="px-2 text-gray-500 bg-white dark:bg-gray-800 dark:text-gray-400">@Localizer["OrText"]</span>
+ <span class="px-2 text-gray-500 bg-white dark:bg-gray-800 dark:text-gray-400">@SharedLocalizer["Or"]</span>
</div>
</div>
@@ -157,6 +154,7 @@ else
private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Auth.Login", "AliasVault.Client");
private IStringLocalizer ApiErrorLocalizer => LocalizerFactory.Create("ApiErrors", "AliasVault.Client");
+ private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
private SrpEphemeral _clientEphemeral = new();
private SrpSession _clientSession = new();
diff --git a/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor b/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor
index 48387ed43..22bd8befa 100644
--- a/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor
+++ b/apps/server/AliasVault.Client/Auth/Pages/MobileUnlock.razor
@@ -48,7 +48,7 @@
<div class="flex w-full">
<button type="button" @onclick="HandleCancel" class="w-full text-gray-900 bg-white border border-gray-300 focus:outline-none hover:bg-gray-100 focus:ring-4 focus:ring-gray-200 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-600 dark:focus:ring-gray-700">
- @Localizer["CancelButton"]
+ @SharedLocalizer["Cancel"]
</button>
</div>
</div>
@@ -65,6 +65,7 @@
private IStringLocalizer Localizer => LocalizerFactory.Create("Pages.Auth.MobileUnlock", "AliasVault.Client");
private IStringLocalizer ApiErrorLocalizer => LocalizerFactory.Create("ApiErrors", "AliasVault.Client");
+ private IStringLocalizer SharedLocalizer => LocalizerFactory.Create("SharedResources", "AliasVault.Client");
/// <inheritdoc />
protected override async Task OnInitializedAsync()
@@ -130,18 +131,10 @@
HandleSuccessfulAuthAsync,
HandleErrorAsync);
}
- catch (HttpRequestException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
- {
- // 404 means the mobile unlock endpoint doesn't exist - server version is too old
- // TODO: this check can be removed at a later time when v1.0 is ready and 0.25.0 release has been out for a while.
- _isLoading = false;
- _errorMessage = Localizer["ServerVersionTooOld"];
- StateHasChanged();
- }
catch (Exception)
{
_isLoading = false;
- _errorMessage = Localizer["InitializationError"];
+ _errorMessage = SharedLocalizer["ErrorUnknown"];
StateHasChanged();
}
}
@@ -185,7 +178,7 @@
catch (Exception)
{
_isLoading = false;
- _errorMessage = Localizer["LoginError"];
+ _errorMessage = SharedLocalizer["ErrorUnknown"];
StateHasChanged();
}
}
diff --git a/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx b/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
index 7879708c2..5c0cef4d4 100644
--- a/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
+++ b/apps/server/AliasVault.Client/Resources/Components/Auth/Login.en.resx
@@ -104,10 +104,6 @@
<value>Log in</value>
<comment>Login button text</comment>
</data>
- <data name="LoginToAccountButton" xml:space="preserve">
- <value>Log in to your account</value>
- <comment>Extended login button text</comment>
- </data>
<!-- Links -->
<data name="LostPasswordLink" xml:space="preserve">
@@ -130,11 +126,6 @@
<value>Log in using mobile app</value>
<comment>Link text for mobile device login</comment>
</data>
- <data name="OrText" xml:space="preserve">
- <value>or</value>
- <comment>Divider text between login options</comment>
- </data>
-
<!-- Descriptions and help text -->
<data name="TwoFactorAuthenticationDescription" xml:space="preserve">
<value>Your login is protected with an authenticator app. Enter your authenticator code below.</value>
diff --git a/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx b/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx
index 9f0f239bc..856e84d6a 100644
--- a/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx
+++ b/apps/server/AliasVault.Client/Resources/Pages/Auth/MobileUnlock.en.resx
@@ -63,23 +63,7 @@
<comment>Page title for mobile unlock feature</comment>
</data>
<data name="ScanQrCodeDescription" xml:space="preserve">
- <value>Scan this QR code with your AliasVault mobile app to login</value>
+ <value>Scan this QR code with your AliasVault mobile app to login.</value>
<comment>Description instructing user to scan QR code</comment>
</data>
- <data name="CancelButton" xml:space="preserve">
- <value>Cancel</value>
- <comment>Button text to cancel mobile unlock</comment>
- </data>
- <data name="InitializationError" xml:space="preserve">
- <value>Failed to initialize mobile login. Please try again.</value>
- <comment>Error message when initialization fails</comment>
- </data>
- <data name="LoginError" xml:space="preserve">
- <value>Failed to complete login. Please try again.</value>
- <comment>Error message when login fails</comment>
- </data>
- <data name="ServerVersionTooOld" xml:space="preserve">
- <value>The AliasVault server needs to be updated to a newer version in order to use this feature. Please contact the server admin if you need help.</value>
- <comment>Error message when server version is too old for mobile unlock</comment>
- </data>
</root>
diff --git a/apps/server/AliasVault.Client/Resources/SharedResources.en.resx b/apps/server/AliasVault.Client/Resources/SharedResources.en.resx
index 29c48d9f1..d66cc2386 100644
--- a/apps/server/AliasVault.Client/Resources/SharedResources.en.resx
+++ b/apps/server/AliasVault.Client/Resources/SharedResources.en.resx
@@ -215,6 +215,10 @@
<value>An error occurred. Please try again.</value>
<comment>Generic error message</comment>
</data>
+ <data name="ErrorUnknown" xml:space="preserve">
+ <value>An unknown error occurred. Please try again.</value>
+ <comment>Generic unknown error message</comment>
+ </data>
<data name="ErrorValidation" xml:space="preserve">
<value>Please correct the errors below.</value>
<comment>Validation error message</comment>
@@ -291,6 +295,10 @@
</data>
<!-- General UI text -->
+ <data name="Or" xml:space="preserve">
+ <value>or</value>
+ <comment>Divider text between options</comment>
+ </data>
<data name="LockVault" xml:space="preserve">
<value>Lock vault</value>
<comment>Tooltip text for lock vault button</comment>