mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
refactor(auth): [PM-9722] remove deprecated LoginDecryptionOptionsComponent
- Remove LoginDecryptionOptionsComponentV1 - Clean up orphaned translation messages - Remove unused styles - Clean up related dependencies Closes PM-9722
This commit is contained in:
@@ -1,105 +0,0 @@
|
||||
<div class="tw-container tw-mx-auto">
|
||||
<div
|
||||
class="tw-mx-auto tw-mt-5 tw-flex tw-max-w-lg tw-flex-col tw-items-center tw-justify-center tw-p-8"
|
||||
>
|
||||
<div class="tw-mb-6">
|
||||
<img class="logo logo-themed" alt="Bitwarden" />
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="loading">
|
||||
<p class="text-center">
|
||||
<i
|
||||
class="bwi bwi-spinner bwi-spin bwi-2x text-muted"
|
||||
title="{{ 'loading' | i18n }}"
|
||||
aria-hidden="true"
|
||||
></i>
|
||||
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
|
||||
</p>
|
||||
</ng-container>
|
||||
|
||||
<div
|
||||
*ngIf="!loading"
|
||||
class="tw-w-full tw-rounded-md tw-border tw-border-solid tw-border-secondary-300 tw-bg-background tw-p-6"
|
||||
>
|
||||
<ng-container *ngIf="data.state == State.ExistingUserUntrustedDevice">
|
||||
<h2 bitTypography="h2" class="tw-mb-6">{{ "loginInitiated" | i18n }}</h2>
|
||||
|
||||
<p bitTypography="body1" class="tw-mb-6">
|
||||
{{ "deviceApprovalRequired" | i18n }}
|
||||
</p>
|
||||
|
||||
<form [formGroup]="rememberDeviceForm">
|
||||
<bit-form-control>
|
||||
<input type="checkbox" bitCheckbox formControlName="rememberDevice" />
|
||||
<bit-label>{{ "rememberThisDevice" | i18n }} </bit-label>
|
||||
<bit-hint bitTypography="body2">{{ "uncheckIfPublicDevice" | i18n }}</bit-hint>
|
||||
</bit-form-control>
|
||||
</form>
|
||||
|
||||
<div class="tw-mb-6 tw-flex tw-flex-col tw-space-y-3">
|
||||
<button
|
||||
*ngIf="data.showApproveFromOtherDeviceBtn"
|
||||
(click)="approveFromOtherDevice()"
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="primary"
|
||||
block
|
||||
>
|
||||
{{ "approveFromYourOtherDevice" | i18n }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
*ngIf="data.showReqAdminApprovalBtn"
|
||||
(click)="requestAdminApproval()"
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="secondary"
|
||||
>
|
||||
{{ "requestAdminApproval" | i18n }}
|
||||
</button>
|
||||
|
||||
<button
|
||||
*ngIf="data.showApproveWithMasterPasswordBtn"
|
||||
(click)="approveWithMasterPassword()"
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="secondary"
|
||||
block
|
||||
>
|
||||
{{ "approveWithMasterPassword" | i18n }}
|
||||
</button>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="data.state == State.NewUser">
|
||||
<h2 bitTypography="h2" class="tw-mb-6">{{ "loggedInExclamation" | i18n }}</h2>
|
||||
|
||||
<form [formGroup]="rememberDeviceForm">
|
||||
<bit-form-control>
|
||||
<input type="checkbox" bitCheckbox formControlName="rememberDevice" />
|
||||
<bit-label>{{ "rememberThisDevice" | i18n }} </bit-label>
|
||||
<bit-hint bitTypography="body2">{{ "uncheckIfPublicDevice" | i18n }}</bit-hint>
|
||||
</bit-form-control>
|
||||
</form>
|
||||
|
||||
<button
|
||||
bitButton
|
||||
type="button"
|
||||
buttonType="primary"
|
||||
block
|
||||
class="tw-mb-6"
|
||||
[bitAction]="createUserAction"
|
||||
>
|
||||
{{ "continue" | i18n }}
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
<hr class="tw-mb-6 tw-mt-0" />
|
||||
|
||||
<div class="tw-m-0 tw-text-sm">
|
||||
<p class="tw-mb-1">{{ "loggingInAs" | i18n }} {{ data.userEmail }}</p>
|
||||
<a [routerLink]="[]" (click)="logOut()">{{ "notYou" | i18n }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
import { Component, inject } from "@angular/core";
|
||||
|
||||
import { BaseLoginDecryptionOptionsComponentV1 } from "@bitwarden/angular/auth/components/base-login-decryption-options-v1.component";
|
||||
|
||||
import { RouterService } from "../../../core";
|
||||
import { AcceptOrganizationInviteService } from "../../organization-invite/accept-organization.service";
|
||||
@Component({
|
||||
selector: "web-login-decryption-options",
|
||||
templateUrl: "login-decryption-options-v1.component.html",
|
||||
})
|
||||
export class LoginDecryptionOptionsComponentV1 extends BaseLoginDecryptionOptionsComponentV1 {
|
||||
protected routerService = inject(RouterService);
|
||||
protected acceptOrganizationInviteService = inject(AcceptOrganizationInviteService);
|
||||
|
||||
override async createUser(): Promise<void> {
|
||||
try {
|
||||
await super.createUser();
|
||||
|
||||
// Invites from TDE orgs go through here, but the invite is
|
||||
// accepted while being enrolled in admin recovery. So we need to clear
|
||||
// the redirect and stored org invite.
|
||||
await this.routerService.getAndClearLoginRedirectUrl();
|
||||
await this.acceptOrganizationInviteService.clearOrganizationInvitation();
|
||||
|
||||
await this.router.navigate(["/vault"]);
|
||||
} catch (error) {
|
||||
this.validationService.showError(error);
|
||||
}
|
||||
}
|
||||
|
||||
createUserAction = async (): Promise<void> => {
|
||||
return this.createUser();
|
||||
};
|
||||
}
|
||||
@@ -4,12 +4,11 @@ import { CheckboxModule } from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../app/shared";
|
||||
|
||||
import { LoginDecryptionOptionsComponentV1 } from "./login-decryption-options/login-decryption-options-v1.component";
|
||||
import { LoginViaWebAuthnComponent } from "./login-via-webauthn/login-via-webauthn.component";
|
||||
|
||||
@NgModule({
|
||||
imports: [SharedModule, CheckboxModule],
|
||||
declarations: [LoginDecryptionOptionsComponentV1, LoginViaWebAuthnComponent],
|
||||
exports: [LoginDecryptionOptionsComponentV1, LoginViaWebAuthnComponent],
|
||||
declarations: [LoginViaWebAuthnComponent],
|
||||
exports: [LoginViaWebAuthnComponent],
|
||||
})
|
||||
export class LoginModule {}
|
||||
|
||||
@@ -7329,12 +7329,6 @@
|
||||
"numberOfUsers": {
|
||||
"message": "Number of users"
|
||||
},
|
||||
"loggingInAs": {
|
||||
"message": "Logging in as"
|
||||
},
|
||||
"notYou": {
|
||||
"message": "Not you?"
|
||||
},
|
||||
"pickAnAvatarColor": {
|
||||
"message": "Pick an avatar color"
|
||||
},
|
||||
@@ -8458,9 +8452,6 @@
|
||||
"requestAdminApproval": {
|
||||
"message": "Request admin approval"
|
||||
},
|
||||
"approveWithMasterPassword": {
|
||||
"message": "Approve with master password"
|
||||
},
|
||||
"trustedDeviceEncryption": {
|
||||
"message": "Trusted device encryption"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user