From 8e70d5b9232b1f15353dc9f41de1e20109725e89 Mon Sep 17 00:00:00 2001 From: Alec Rippberger <127791530+alec-livefront@users.noreply.github.com> Date: Fri, 31 Jan 2025 11:54:41 -0600 Subject: [PATCH] feat(auth): [PM-3953] generalize copy for login with device flows Updates UI text and translations for the login with device feature to be more consistent and clear across desktop, browser and web clients. Changes include: - Updated titles and content for login via auth request components - Revised translations for device approval modal - Updated notification titles and alert messages - Simplified device management URL handling - Added missing translations across platforms Resolves PM-3953 --- apps/browser/src/_locales/en/messages.json | 15 ++++++-- .../login-via-auth-request-v1.component.html | 15 +++++--- apps/browser/src/popup/app-routing.module.ts | 2 +- apps/desktop/src/app/app-routing.module.ts | 2 +- ...p-login-approval-component.service.spec.ts | 6 ++-- ...esktop-login-approval-component.service.ts | 8 ++--- .../login-via-auth-request-v1.component.html | 16 ++++++--- apps/desktop/src/locales/en/messages.json | 36 ++++++++++++------- .../login-via-auth-request-v1.component.html | 20 ++++------- apps/web/src/app/oss-routing.module.ts | 2 +- apps/web/src/locales/en/messages.json | 36 +++++++++++++++++-- .../login-via-auth-request-v1.component.ts | 9 ++++- .../login-approval.component.html | 8 ++--- .../login-approval.component.ts | 2 +- .../login-via-auth-request.component.html | 16 ++++++++- .../login-via-auth-request.component.ts | 10 ++++++ 16 files changed, 146 insertions(+), 57 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 9a06db4ed73..10efba9422f 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -3123,12 +3123,18 @@ "notificationSentDevice": { "message": "A notification has been sent to your device." }, + "notificationSentDevicePart1": { + "message": "Unlock Bitwarden on your device or on the" + }, + "notificationSentDeviceAnchor": { + "message": "web app" + }, + "notificationSentDevicePart2": { + "message": "Make sure the Fingerprint phrase matches the one below before approving." + }, "aNotificationWasSentToYourDevice": { "message": "A notification was sent to your device" }, - "makeSureYourAccountIsUnlockedAndTheFingerprintEtc": { - "message": "Make sure your account is unlocked and the fingerprint phrase matches on the other device" - }, "youWillBeNotifiedOnceTheRequestIsApproved": { "message": "You will be notified once the request is approved" }, @@ -3138,6 +3144,9 @@ "loginInitiated": { "message": "Login initiated" }, + "logInRequestSent": { + "message": "Request sent" + }, "exposedMasterPassword": { "message": "Exposed Master Password" }, diff --git a/apps/browser/src/auth/popup/login-via-auth-request-v1.component.html b/apps/browser/src/auth/popup/login-via-auth-request-v1.component.html index e7fafbb252c..34c0cbe9614 100644 --- a/apps/browser/src/auth/popup/login-via-auth-request-v1.component.html +++ b/apps/browser/src/auth/popup/login-via-auth-request-v1.component.html @@ -7,13 +7,20 @@
{{ "loginInitiated" | i18n }}
+{{ "logInRequestSent" | i18n }}
{{ "notificationSentDevice" | i18n }}
-- {{ "fingerprintMatchInfo" | i18n }} + {{ "notificationSentDevicePart1" | i18n }} + {{ "notificationSentDeviceAnchor" | i18n }}. {{ "notificationSentDevicePart2" | i18n }}
{{ "loginInitiated" | i18n }}
+{{ "logInRequestSent" | i18n }}
{{ "notificationSentDevice" | i18n }}
-- {{ "fingerprintMatchInfo" | i18n }} +
+ {{ "notificationSentDevicePart1" | i18n }} + {{ "notificationSentDeviceAnchor" | i18n }}. {{ "notificationSentDevicePart2" | i18n }}
{{ "notificationSentDevice" | i18n }}
- -- {{ "fingerprintMatchInfo" | i18n }} -
-+ {{ "notificationSentDeviceComplete" | i18n }} +
{{ "adminApprovalRequestSentToAdmins" | i18n }}
{{ "youWillBeNotifiedOnceApproved" | i18n }}
{{ fingerprintPhrase }}
@@ -35,7 +35,7 @@ [bitAction]="approveLogin" [disabled]="loading" > - {{ "confirmLogIn" | i18n }} + {{ "confirmAccess" | i18n }} diff --git a/libs/auth/src/angular/login-approval/login-approval.component.ts b/libs/auth/src/angular/login-approval/login-approval.component.ts index 3b44f545abb..54d90306e5c 100644 --- a/libs/auth/src/angular/login-approval/login-approval.component.ts +++ b/libs/auth/src/angular/login-approval/login-approval.component.ts @@ -85,7 +85,7 @@ export class LoginApprovalComponent implements OnInit, OnDestroy { } const publicKey = Utils.fromB64ToArray(this.authRequestResponse.publicKey); - this.email = await await firstValueFrom( + this.email = await firstValueFrom( this.accountService.activeAccount$.pipe(map((a) => a?.email)), ); this.fingerprintPhrase = await this.authRequestService.getFingerprintPhrase( diff --git a/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.html b/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.html index a1d0f200c15..ba26ba77cb0 100644 --- a/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.html +++ b/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.html @@ -1,6 +1,20 @@{{ "makeSureYourAccountIsUnlockedAndTheFingerprintEtc" | i18n }}
++ {{ "notificationSentDevicePart1" | i18n }} + {{ "notificationSentDeviceAnchor" | i18n }}. {{ "notificationSentDevicePart2" | i18n }} +
++ {{ "notificationSentDeviceComplete" | i18n }} +
{{ fingerprintPhrase }}
diff --git a/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.ts b/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.ts
index b9a5ee4fe73..00e2d621c47 100644
--- a/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.ts
+++ b/libs/auth/src/angular/login-via-auth-request/login-via-auth-request.component.ts
@@ -29,6 +29,7 @@ import { ClientType, HttpStatusCode } from "@bitwarden/common/enums";
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
+import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@@ -71,6 +72,8 @@ export class LoginViaAuthRequestComponent implements OnInit, OnDestroy {
protected showResendNotification = false;
protected Flow = Flow;
protected flow = Flow.StandardAuthRequest;
+ protected webVaultUrl: string;
+ protected deviceManagementUrl: string;
constructor(
private accountService: AccountService,
@@ -81,6 +84,7 @@ export class LoginViaAuthRequestComponent implements OnInit, OnDestroy {
private authService: AuthService,
private cryptoFunctionService: CryptoFunctionService,
private deviceTrustService: DeviceTrustServiceAbstraction,
+ private environmentService: EnvironmentService,
private i18nService: I18nService,
private logService: LogService,
private loginEmailService: LoginEmailServiceAbstraction,
@@ -109,6 +113,12 @@ export class LoginViaAuthRequestComponent implements OnInit, OnDestroy {
this.logService.error("Failed to use approved auth request: " + e.message);
});
});
+
+ // Get the web vault URL from the environment service
+ this.environmentService.environment$.pipe(takeUntilDestroyed()).subscribe((env) => {
+ this.webVaultUrl = env.getWebVaultUrl();
+ this.deviceManagementUrl = `${this.webVaultUrl}/#/settings/security/device-management`;
+ });
}
async ngOnInit(): Promise