diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 7b11b9e3fed..2a9dc9be4f8 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -1177,7 +1177,7 @@ "message": "After changing your password, you will need to log in with your new password. Active sessions on other devices will be logged out within one hour." }, "accountRecoveryUpdateMasterPasswordSubtitle": { - "message": "Admins have recovered your account. Change you master password to continue." + "message": "Change your master password to complete account recovery." }, "enableChangedPasswordNotification": { "message": "Ask to update existing login" diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index 7ea0b9379ad..3469d32a0f0 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -342,9 +342,6 @@ const routes: Routes = [ component: ChangePasswordComponent, }, ], - data: { - showBackButton: true, - } satisfies ExtensionAnonLayoutWrapperData, }, ], }, diff --git a/apps/web/src/app/oss-routing.module.ts b/apps/web/src/app/oss-routing.module.ts index 69d0aa761f2..9c6174cea23 100644 --- a/apps/web/src/app/oss-routing.module.ts +++ b/apps/web/src/app/oss-routing.module.ts @@ -154,6 +154,9 @@ const routes: Routes = [ component: ChangePasswordComponent, }, ], + data: { + hideFooter: true, + } satisfies AnonLayoutWrapperData, }, ], data: { titleId: "updatePassword" } satisfies RouteDataProperties, @@ -164,7 +167,7 @@ const routes: Routes = [ canActivate: [ canAccessFeature( FeatureFlag.PM16117_ChangeExistingPasswordRefactor, - false, + true, "change-password", false, ), diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index e23a433b23f..f9ce18952b5 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -6057,7 +6057,7 @@ "message": "Update master password" }, "accountRecoveryUpdateMasterPasswordSubtitle": { - "message": "Admins have recovered your account. Change you master password to continue." + "message": "Change your master password to complete account recovery." }, "updateMasterPasswordSubtitle": { "message": "Your master password does not meet this organization’s requirements. Change your master password to continue." diff --git a/libs/auth/src/angular/change-password/change-password.component.html b/libs/auth/src/angular/change-password/change-password.component.html index 90c587ae553..eee0c4fe2ea 100644 --- a/libs/auth/src/angular/change-password/change-password.component.html +++ b/libs/auth/src/angular/change-password/change-password.component.html @@ -10,13 +10,22 @@ [flow]="inputPasswordFlow" [email]="email" [userId]="activeUserId" + [forceSetPasswordReason]="forceSetPasswordReason" [loading]="submitting" [masterPasswordPolicyOptions]="masterPasswordPolicyOptions" [inlineButtons]="true" [primaryButtonText]="{ key: 'changeMasterPassword' }" (onPasswordFormSubmit)="handlePasswordFormSubmit($event)" - [secondaryButtonText]="{ key: 'cancel' }" + [secondaryButtonText]=" + this.forceSetPasswordReason === ForceSetPasswordReason.AdminForcePasswordReset || + this.forceSetPasswordReason === ForceSetPasswordReason.WeakMasterPassword + ? { key: 'logOut' } + : undefined + " (onSecondaryButtonClick)="logOut()" + [showChangePasswordWarning]=" + this.forceSetPasswordReason !== ForceSetPasswordReason.AdminForcePasswordReset + " > } diff --git a/libs/auth/src/angular/change-password/change-password.component.ts b/libs/auth/src/angular/change-password/change-password.component.ts index 761991d0478..c8309098a91 100644 --- a/libs/auth/src/angular/change-password/change-password.component.ts +++ b/libs/auth/src/angular/change-password/change-password.component.ts @@ -7,6 +7,7 @@ import { Account, AccountService } from "@bitwarden/common/auth/abstractions/acc import { ForceSetPasswordReason } from "@bitwarden/common/auth/models/domain/force-set-password-reason"; import { InternalMasterPasswordServiceAbstraction } from "@bitwarden/common/key-management/master-password/abstractions/master-password.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { SyncService } from "@bitwarden/common/platform/sync"; import { UserId } from "@bitwarden/common/types/guid"; @@ -33,7 +34,7 @@ export class ChangePasswordComponent implements OnInit { @Input() inputPasswordFlow: InputPasswordFlow = InputPasswordFlow.ChangePassword; activeAccount: Account | null = null; - email?: string; + email!: string; activeUserId?: UserId; masterPasswordPolicyOptions?: MasterPasswordPolicyOptions; initializing = true; @@ -53,6 +54,7 @@ export class ChangePasswordComponent implements OnInit { private toastService: ToastService, private syncService: SyncService, private dialogService: DialogService, + private logService: LogService, ) {} async ngOnInit() { @@ -83,8 +85,6 @@ export class ChangePasswordComponent implements OnInit { pageIcon: LockIcon, pageTitle: { key: "updateMasterPassword" }, pageSubtitle: { key: "accountRecoveryUpdateMasterPasswordSubtitle" }, - hideFooter: true, - maxWidth: "lg", }); } else if (this.forceSetPasswordReason === ForceSetPasswordReason.WeakMasterPassword) { this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({ @@ -153,7 +153,8 @@ export class ChangePasswordComponent implements OnInit { this.messagingService.send("logout"); } - } catch { + } catch (error) { + this.logService.error(error); this.toastService.showToast({ variant: "error", title: "", @@ -163,4 +164,6 @@ export class ChangePasswordComponent implements OnInit { this.submitting = false; } } + + protected readonly ForceSetPasswordReason = ForceSetPasswordReason; } diff --git a/libs/auth/src/angular/input-password/input-password.component.html b/libs/auth/src/angular/input-password/input-password.component.html index 88b5f3f1ce2..4111964f2db 100644 --- a/libs/auth/src/angular/input-password/input-password.component.html +++ b/libs/auth/src/angular/input-password/input-password.component.html @@ -1,17 +1,14 @@