From c739a884b4234552477a8afe2505ddd440eb2b0b Mon Sep 17 00:00:00 2001 From: Ike <137194738+ike-kottlowski@users.noreply.github.com> Date: Fri, 7 Mar 2025 18:03:13 -0500 Subject: [PATCH] [PM-15015] Adding Request Country Name to auth requests approval dialog (#13718) * feat(pm-15015) : - Adding `requestCountryName` to auth requests dialogs, and response models. - Updated i18n messages.json in Web, Browser, and Desktop to include "Location" translation. --- apps/browser/src/_locales/en/messages.json | 3 +++ apps/desktop/src/locales/en/messages.json | 5 ++++- apps/web/src/locales/en/messages.json | 3 +++ .../auth-requests/pending-auth-request.view.ts | 1 + .../pending-organization-auth-request.response.ts | 2 ++ .../angular/login-approval/login-approval.component.html | 7 +++++-- .../login-via-auth-request.component.ts | 2 +- .../src/auth/models/response/auth-request.response.ts | 2 ++ 8 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index bdeffad2bbf..1679fcfcf3f 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -901,6 +901,9 @@ "no": { "message": "No" }, + "location": { + "message": "Location" + }, "unexpectedError": { "message": "An unexpected error has occurred." }, diff --git a/apps/desktop/src/locales/en/messages.json b/apps/desktop/src/locales/en/messages.json index 1b49b7ce3a0..b485b471ccb 100644 --- a/apps/desktop/src/locales/en/messages.json +++ b/apps/desktop/src/locales/en/messages.json @@ -878,7 +878,7 @@ }, "useYourRecoveryCode": { "message": "Use your recovery code" - }, + }, "insertYubiKey": { "message": "Insert your YubiKey into your computer's USB port, then touch its button." }, @@ -1009,6 +1009,9 @@ "no": { "message": "No" }, + "location": { + "message": "Location" + }, "overwritePassword": { "message": "Overwrite password" }, diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 499e0575727..229cca65ae5 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -1053,6 +1053,9 @@ "no": { "message": "No" }, + "location": { + "message": "Location" + }, "loginOrCreateNewAccount": { "message": "Log in or create a new account to access your secure vault." }, diff --git a/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-auth-request.view.ts b/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-auth-request.view.ts index d32d6fcfbc7..b0f65cd3f76 100644 --- a/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-auth-request.view.ts +++ b/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-auth-request.view.ts @@ -13,6 +13,7 @@ export class PendingAuthRequestView implements View { requestDeviceIdentifier: string; requestDeviceType: string; requestIpAddress: string; + requestCountryName: string; creationDate: Date; static fromResponse(response: PendingOrganizationAuthRequestResponse): PendingAuthRequestView { diff --git a/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-organization-auth-request.response.ts b/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-organization-auth-request.response.ts index b4854eea4aa..0f686d17edd 100644 --- a/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-organization-auth-request.response.ts +++ b/bitwarden_license/bit-common/src/admin-console/auth-requests/pending-organization-auth-request.response.ts @@ -9,6 +9,7 @@ export class PendingOrganizationAuthRequestResponse extends BaseResponse { requestDeviceIdentifier: string; requestDeviceType: string; requestIpAddress: string; + requestCountryName: string; creationDate: string; constructor(response: any) { @@ -21,6 +22,7 @@ export class PendingOrganizationAuthRequestResponse extends BaseResponse { this.requestDeviceIdentifier = this.getResponseProperty("RequestDeviceIdentifier"); this.requestDeviceType = this.getResponseProperty("RequestDeviceType"); this.requestIpAddress = this.getResponseProperty("RequestIpAddress"); + this.requestCountryName = this.getResponseProperty("RequestCountryName"); this.creationDate = this.getResponseProperty("CreationDate"); } } diff --git a/libs/auth/src/angular/login-approval/login-approval.component.html b/libs/auth/src/angular/login-approval/login-approval.component.html index 2115bdbff11..d37e30c5e0a 100644 --- a/libs/auth/src/angular/login-approval/login-approval.component.html +++ b/libs/auth/src/angular/login-approval/login-approval.component.html @@ -18,8 +18,11 @@
{{ authRequestResponse?.requestDeviceType }}
{{ authRequestResponse?.requestIpAddress }}
+ {{ "location" | i18n }} ++ {{ authRequestResponse?.requestCountryName }} + ({{ authRequestResponse?.requestIpAddress }}) +