mirror of
https://github.com/bitwarden/web
synced 2025-12-15 15:53:18 +00:00
Compare commits
7 Commits
feature/ap
...
PS-589-add
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1f30641de | ||
|
|
6b0d793bf9 | ||
|
|
0d35dff990 | ||
|
|
42cd171685 | ||
|
|
8ef27713f1 | ||
|
|
57b647bde5 | ||
|
|
681ace4b1b |
2
jslib
2
jslib
Submodule jslib updated: 3cb94623e2...52cc640537
@@ -101,7 +101,7 @@
|
|||||||
<div [ngClass]="{ 'col-5': layout, 'col-12': !layout }">
|
<div [ngClass]="{ 'col-5': layout, 'col-12': !layout }">
|
||||||
<div class="row justify-content-md-center mt-5">
|
<div class="row justify-content-md-center mt-5">
|
||||||
<div [ngClass]="{ 'col-5': !layout, 'col-12': layout }">
|
<div [ngClass]="{ 'col-5': !layout, 'col-12': layout }">
|
||||||
<p class="lead text-center mb-4" *ngIf="!layout">{{ "createAccount" | i18n }}</p>
|
<h1 class="lead text-center mb-4" *ngIf="!layout">{{ "createAccount" | i18n }}</h1>
|
||||||
<div class="card d-block">
|
<div class="card d-block">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<app-callout
|
<app-callout
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ import { EmergencyAccessTakeoverComponent } from "../settings/emergency-access-t
|
|||||||
import { EmergencyAccessViewComponent } from "../settings/emergency-access-view.component";
|
import { EmergencyAccessViewComponent } from "../settings/emergency-access-view.component";
|
||||||
import { EmergencyAccessComponent } from "../settings/emergency-access.component";
|
import { EmergencyAccessComponent } from "../settings/emergency-access.component";
|
||||||
import { EmergencyAddEditComponent } from "../settings/emergency-add-edit.component";
|
import { EmergencyAddEditComponent } from "../settings/emergency-add-edit.component";
|
||||||
import { LinkSsoComponent } from "../settings/link-sso.component";
|
|
||||||
import { OrganizationPlansComponent } from "../settings/organization-plans.component";
|
import { OrganizationPlansComponent } from "../settings/organization-plans.component";
|
||||||
import { PaymentMethodComponent } from "../settings/payment-method.component";
|
import { PaymentMethodComponent } from "../settings/payment-method.component";
|
||||||
import { PaymentComponent } from "../settings/payment.component";
|
import { PaymentComponent } from "../settings/payment.component";
|
||||||
@@ -223,7 +222,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga
|
|||||||
HintComponent,
|
HintComponent,
|
||||||
ImportComponent,
|
ImportComponent,
|
||||||
InactiveTwoFactorReportComponent,
|
InactiveTwoFactorReportComponent,
|
||||||
LinkSsoComponent,
|
|
||||||
LockComponent,
|
LockComponent,
|
||||||
LoginComponent,
|
LoginComponent,
|
||||||
MasterPasswordPolicyComponent,
|
MasterPasswordPolicyComponent,
|
||||||
@@ -383,7 +381,6 @@ import { OrganizationBadgeModule } from "./vault/modules/organization-badge/orga
|
|||||||
HintComponent,
|
HintComponent,
|
||||||
ImportComponent,
|
ImportComponent,
|
||||||
InactiveTwoFactorReportComponent,
|
InactiveTwoFactorReportComponent,
|
||||||
LinkSsoComponent,
|
|
||||||
LockComponent,
|
LockComponent,
|
||||||
LoginComponent,
|
LoginComponent,
|
||||||
MasterPasswordPolicyComponent,
|
MasterPasswordPolicyComponent,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<span class="filter-buttons">
|
<span class="filter-buttons">
|
||||||
<a href="#" routerLink="/create-organization" class="filter-button">
|
<a href="#" routerLink="/create-organization" class="filter-button">
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
{{ "newOrganization" | i18n }}
|
{{ "newOrganization" | i18n }}
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
@@ -45,14 +45,6 @@
|
|||||||
>
|
>
|
||||||
{{ organizationGrouping.name | i18n }}
|
{{ organizationGrouping.name | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<a
|
|
||||||
href="#"
|
|
||||||
routerLink="/create-organization"
|
|
||||||
class="text-muted ml-auto create-organization-link"
|
|
||||||
appA11yTitle="{{ 'newOrganization' | i18n }}"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<ul id="organization-filters" *ngIf="!isCollapsed" class="filter-options">
|
<ul id="organization-filters" *ngIf="!isCollapsed" class="filter-options">
|
||||||
<li
|
<li
|
||||||
@@ -75,6 +67,14 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="filter-option">
|
||||||
|
<span class="filter-buttons">
|
||||||
|
<a href="#" routerLink="/create-organization" class="filter-button">
|
||||||
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
|
{{ "newOrganization" | i18n }}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ng-container *ngSwitchCase="'singleOrganizationAndPersonalOwnershipPolicies'">
|
<ng-container *ngSwitchCase="'singleOrganizationAndPersonalOwnershipPolicies'">
|
||||||
@@ -110,15 +110,6 @@
|
|||||||
>
|
>
|
||||||
{{ organizationGrouping.name | i18n }}
|
{{ organizationGrouping.name | i18n }}
|
||||||
</button>
|
</button>
|
||||||
<a
|
|
||||||
href="#"
|
|
||||||
routerLink="/create-organization"
|
|
||||||
class="text-muted ml-auto create-organization-link"
|
|
||||||
appA11yTitle="{{ 'newOrganization' | i18n }}"
|
|
||||||
*ngIf="!(displayMode === 'singleOrganizationPolicy')"
|
|
||||||
>
|
|
||||||
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
<ul id="organization-filters" *ngIf="!isCollapsed" class="filter-options">
|
<ul id="organization-filters" *ngIf="!isCollapsed" class="filter-options">
|
||||||
<li class="filter-option" [ngClass]="{ active: activeFilter.myVaultOnly }">
|
<li class="filter-option" [ngClass]="{ active: activeFilter.myVaultOnly }">
|
||||||
@@ -149,6 +140,14 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="filter-option" *ngIf="!(displayMode === 'singleOrganizationPolicy')">
|
||||||
|
<span class="filter-buttons">
|
||||||
|
<a href="#" routerLink="/create-organization" class="filter-button">
|
||||||
|
<i class="bwi bwi-plus bwi-fw" aria-hidden="true"></i>
|
||||||
|
{{ "newOrganization" | i18n }}
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { SharedModule } from "../shared.module";
|
|||||||
|
|
||||||
import { CollectionFilterComponent } from "./components/collection-filter.component";
|
import { CollectionFilterComponent } from "./components/collection-filter.component";
|
||||||
import { FolderFilterComponent } from "./components/folder-filter.component";
|
import { FolderFilterComponent } from "./components/folder-filter.component";
|
||||||
|
import { LinkSsoComponent } from "./components/link-sso.component";
|
||||||
import { OrganizationFilterComponent } from "./components/organization-filter.component";
|
import { OrganizationFilterComponent } from "./components/organization-filter.component";
|
||||||
import { OrganizationOptionsComponent } from "./components/organization-options.component";
|
import { OrganizationOptionsComponent } from "./components/organization-options.component";
|
||||||
import { StatusFilterComponent } from "./components/status-filter.component";
|
import { StatusFilterComponent } from "./components/status-filter.component";
|
||||||
@@ -28,6 +29,7 @@ import { VaultFilterComponent } from "./vault-filter.component";
|
|||||||
OrganizationOptionsComponent,
|
OrganizationOptionsComponent,
|
||||||
StatusFilterComponent,
|
StatusFilterComponent,
|
||||||
TypeFilterComponent,
|
TypeFilterComponent,
|
||||||
|
LinkSsoComponent,
|
||||||
],
|
],
|
||||||
exports: [VaultFilterComponent],
|
exports: [VaultFilterComponent],
|
||||||
providers: [
|
providers: [
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
updateKeyModalRef: ViewContainerRef;
|
updateKeyModalRef: ViewContainerRef;
|
||||||
|
|
||||||
favorites = false;
|
favorites = false;
|
||||||
type: CipherType = null;
|
|
||||||
folderId: string = null;
|
folderId: string = null;
|
||||||
collectionId: string = null;
|
collectionId: string = null;
|
||||||
organizationId: string = null;
|
organizationId: string = null;
|
||||||
@@ -327,7 +326,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
async addCipher() {
|
async addCipher() {
|
||||||
const component = await this.editCipher(null);
|
const component = await this.editCipher(null);
|
||||||
component.type = this.type;
|
component.type = this.activeFilter.cipherType;
|
||||||
component.folderId = this.folderId === "none" ? null : this.folderId;
|
component.folderId = this.folderId === "none" ? null : this.folderId;
|
||||||
if (this.activeFilter.selectedCollectionId != null) {
|
if (this.activeFilter.selectedCollectionId != null) {
|
||||||
const collection = this.filterComponent.collections.fullList.filter(
|
const collection = this.filterComponent.collections.fullList.filter(
|
||||||
@@ -399,7 +398,7 @@ export class IndividualVaultComponent implements OnInit, OnDestroy {
|
|||||||
if (queryParams == null) {
|
if (queryParams == null) {
|
||||||
queryParams = {
|
queryParams = {
|
||||||
favorites: this.favorites ? true : null,
|
favorites: this.favorites ? true : null,
|
||||||
type: this.type,
|
type: this.activeFilter.cipherType,
|
||||||
folderId: this.folderId,
|
folderId: this.folderId,
|
||||||
collectionId: this.collectionId,
|
collectionId: this.collectionId,
|
||||||
deleted: this.deleted ? true : null,
|
deleted: this.deleted ? true : null,
|
||||||
|
|||||||
@@ -3,7 +3,10 @@ import { ActivatedRoute } from "@angular/router";
|
|||||||
|
|
||||||
import { ModalService } from "jslib-angular/services/modal.service";
|
import { ModalService } from "jslib-angular/services/modal.service";
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
@@ -22,9 +25,21 @@ export class TwoFactorSetupComponent extends BaseTwoFactorSetupComponent {
|
|||||||
messagingService: MessagingService,
|
messagingService: MessagingService,
|
||||||
policyService: PolicyService,
|
policyService: PolicyService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
stateService: StateService
|
stateService: StateService,
|
||||||
|
platformUtilsService: PlatformUtilsService,
|
||||||
|
i18nService: I18nService,
|
||||||
|
logService: LogService
|
||||||
) {
|
) {
|
||||||
super(apiService, modalService, messagingService, policyService, stateService);
|
super(
|
||||||
|
apiService,
|
||||||
|
modalService,
|
||||||
|
messagingService,
|
||||||
|
policyService,
|
||||||
|
stateService,
|
||||||
|
platformUtilsService,
|
||||||
|
i18nService,
|
||||||
|
logService
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<form #form (ngSubmit)="load()" [appApiAction]="formPromise" class="container" ngNativeValidate>
|
<form #form (ngSubmit)="load()" [appApiAction]="formPromise" class="container" ngNativeValidate>
|
||||||
<div class="row justify-content-center mt-5">
|
<div class="row justify-content-center mt-5">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<p class="lead text-center mb-4">Bitwarden Send</p>
|
<h1 class="lead text-center mb-4">Bitwarden Send</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 text-center" *ngIf="creatorIdentifier != null">
|
<div class="col-12 text-center" *ngIf="creatorIdentifier != null">
|
||||||
<p>{{ "sendCreatorIdentifier" | i18n: creatorIdentifier }}</p>
|
<p>{{ "sendCreatorIdentifier" | i18n: creatorIdentifier }}</p>
|
||||||
|
|||||||
@@ -35,10 +35,6 @@
|
|||||||
icon="bwi bwi-key"
|
icon="bwi bwi-key"
|
||||||
*ngIf="clientSecret"
|
*ngIf="clientSecret"
|
||||||
>
|
>
|
||||||
<p class="mb-1">
|
|
||||||
<strong>combined:</strong>
|
|
||||||
<code>{{ combinedApiKey }}</code>
|
|
||||||
</p>
|
|
||||||
<p class="mb-1">
|
<p class="mb-1">
|
||||||
<strong>client_id:</strong><br />
|
<strong>client_id:</strong><br />
|
||||||
<code>{{ clientId }}</code>
|
<code>{{ clientId }}</code>
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
import { Component, OnInit } from "@angular/core";
|
import { Component } from "@angular/core";
|
||||||
|
|
||||||
import { CryptoService } from "jslib-common/abstractions/crypto.service";
|
|
||||||
import { LogService } from "jslib-common/abstractions/log.service";
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
import { UserVerificationService } from "jslib-common/abstractions/userVerification.service";
|
||||||
import { Utils } from "jslib-common/misc/utils";
|
|
||||||
import { SecretVerificationRequest } from "jslib-common/models/request/secretVerificationRequest";
|
import { SecretVerificationRequest } from "jslib-common/models/request/secretVerificationRequest";
|
||||||
import { ApiKeyResponse } from "jslib-common/models/response/apiKeyResponse";
|
import { ApiKeyResponse } from "jslib-common/models/response/apiKeyResponse";
|
||||||
import { Verification } from "jslib-common/types/verification";
|
import { Verification } from "jslib-common/types/verification";
|
||||||
@@ -12,7 +10,7 @@ import { Verification } from "jslib-common/types/verification";
|
|||||||
selector: "app-api-key",
|
selector: "app-api-key",
|
||||||
templateUrl: "api-key.component.html",
|
templateUrl: "api-key.component.html",
|
||||||
})
|
})
|
||||||
export class ApiKeyComponent implements OnInit {
|
export class ApiKeyComponent {
|
||||||
keyType: string;
|
keyType: string;
|
||||||
isRotation: boolean;
|
isRotation: boolean;
|
||||||
postKey: (entityId: string, request: SecretVerificationRequest) => Promise<ApiKeyResponse>;
|
postKey: (entityId: string, request: SecretVerificationRequest) => Promise<ApiKeyResponse>;
|
||||||
@@ -27,20 +25,12 @@ export class ApiKeyComponent implements OnInit {
|
|||||||
formPromise: Promise<ApiKeyResponse>;
|
formPromise: Promise<ApiKeyResponse>;
|
||||||
clientId: string;
|
clientId: string;
|
||||||
clientSecret: string;
|
clientSecret: string;
|
||||||
clientKey: string;
|
|
||||||
clientLocalKeyHash: string;
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private cryptoService: CryptoService,
|
|
||||||
private userVerificationService: UserVerificationService,
|
private userVerificationService: UserVerificationService,
|
||||||
private logService: LogService
|
private logService: LogService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit(): Promise<void> {
|
|
||||||
this.clientKey = Utils.fromBufferToB64((await this.cryptoService.getKey()).key);
|
|
||||||
this.clientLocalKeyHash = await this.cryptoService.getKeyHash();
|
|
||||||
}
|
|
||||||
|
|
||||||
async submit() {
|
async submit() {
|
||||||
try {
|
try {
|
||||||
this.formPromise = this.userVerificationService
|
this.formPromise = this.userVerificationService
|
||||||
@@ -53,17 +43,4 @@ export class ApiKeyComponent implements OnInit {
|
|||||||
this.logService.error(e);
|
this.logService.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get combinedApiKey() {
|
|
||||||
return Utils.fromUtf8ToB64(
|
|
||||||
JSON.stringify({
|
|
||||||
clientId: this.clientId,
|
|
||||||
clientSecret: this.clientSecret,
|
|
||||||
encClientEncInfo: JSON.stringify({
|
|
||||||
clientEncKey: this.clientKey,
|
|
||||||
clientLocalKeyHash: this.clientLocalKeyHash,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<form *ngIf="!loading" #form (ngSubmit)="submit()" [appApiAction]="formPromise" ngNativeValidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h2 class="mt-5 spaced-header">
|
||||||
|
{{ "deviceVerification" | i18n }}
|
||||||
|
</h2>
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="form-check">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
id="enableDeviceVerification"
|
||||||
|
name="enableDeviceVerification"
|
||||||
|
disabled="{{ !isDeviceVerificationSectionEnabled }}"
|
||||||
|
[(ngModel)]="enableDeviceVerification"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="enableDeviceVerification">
|
||||||
|
{{ "enableDeviceVerification" | i18n }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<small class="form-text text-muted">{{ "deviceVerificationDesc" | i18n }}</small>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-primary btn-submit"
|
||||||
|
[disabled]="form.loading"
|
||||||
|
*ngIf="isDeviceVerificationSectionEnabled"
|
||||||
|
>
|
||||||
|
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
|
||||||
|
<span>{{ "save" | i18n }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
<ng-template #authenticatorTemplate></ng-template>
|
<ng-template #authenticatorTemplate></ng-template>
|
||||||
<ng-template #recoveryTemplate></ng-template>
|
<ng-template #recoveryTemplate></ng-template>
|
||||||
|
|||||||
@@ -3,11 +3,15 @@ import { Component, OnInit, Type, ViewChild, ViewContainerRef } from "@angular/c
|
|||||||
import { ModalRef } from "jslib-angular/components/modal/modal.ref";
|
import { ModalRef } from "jslib-angular/components/modal/modal.ref";
|
||||||
import { ModalService } from "jslib-angular/services/modal.service";
|
import { ModalService } from "jslib-angular/services/modal.service";
|
||||||
import { ApiService } from "jslib-common/abstractions/api.service";
|
import { ApiService } from "jslib-common/abstractions/api.service";
|
||||||
|
import { I18nService } from "jslib-common/abstractions/i18n.service";
|
||||||
|
import { LogService } from "jslib-common/abstractions/log.service";
|
||||||
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
import { MessagingService } from "jslib-common/abstractions/messaging.service";
|
||||||
|
import { PlatformUtilsService } from "jslib-common/abstractions/platformUtils.service";
|
||||||
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
import { PolicyService } from "jslib-common/abstractions/policy.service";
|
||||||
import { StateService } from "jslib-common/abstractions/state.service";
|
import { StateService } from "jslib-common/abstractions/state.service";
|
||||||
import { PolicyType } from "jslib-common/enums/policyType";
|
import { PolicyType } from "jslib-common/enums/policyType";
|
||||||
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
import { TwoFactorProviderType } from "jslib-common/enums/twoFactorProviderType";
|
||||||
|
import { DeviceVerificationRequest } from "jslib-common/models/request/DeviceVerificationRequest";
|
||||||
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
import { TwoFactorProviders } from "jslib-common/services/twoFactor.service";
|
||||||
|
|
||||||
import { TwoFactorAuthenticatorComponent } from "./two-factor-authenticator.component";
|
import { TwoFactorAuthenticatorComponent } from "./two-factor-authenticator.component";
|
||||||
@@ -39,18 +43,32 @@ export class TwoFactorSetupComponent implements OnInit {
|
|||||||
canAccessPremium: boolean;
|
canAccessPremium: boolean;
|
||||||
showPolicyWarning = false;
|
showPolicyWarning = false;
|
||||||
loading = true;
|
loading = true;
|
||||||
|
enableDeviceVerification: boolean;
|
||||||
|
isDeviceVerificationSectionEnabled: boolean;
|
||||||
modal: ModalRef;
|
modal: ModalRef;
|
||||||
|
formPromise: Promise<any>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected apiService: ApiService,
|
protected apiService: ApiService,
|
||||||
protected modalService: ModalService,
|
protected modalService: ModalService,
|
||||||
protected messagingService: MessagingService,
|
protected messagingService: MessagingService,
|
||||||
protected policyService: PolicyService,
|
protected policyService: PolicyService,
|
||||||
private stateService: StateService
|
private stateService: StateService,
|
||||||
|
private platformUtilsService: PlatformUtilsService,
|
||||||
|
private i18nService: I18nService,
|
||||||
|
private logService: LogService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
this.canAccessPremium = await this.stateService.getCanAccessPremium();
|
||||||
|
try {
|
||||||
|
const deviceVerificationSettings = await this.apiService.getDeviceVerificationSettings();
|
||||||
|
this.isDeviceVerificationSectionEnabled =
|
||||||
|
deviceVerificationSettings.isDeviceVerificationSectionEnabled;
|
||||||
|
this.enableDeviceVerification = deviceVerificationSettings.unknownDeviceVerificationEnabled;
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
for (const key in TwoFactorProviders) {
|
for (const key in TwoFactorProviders) {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
@@ -186,4 +204,37 @@ export class TwoFactorSetupComponent implements OnInit {
|
|||||||
this.showPolicyWarning = false;
|
this.showPolicyWarning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async submit() {
|
||||||
|
try {
|
||||||
|
if (this.enableDeviceVerification) {
|
||||||
|
const email = await this.stateService.getEmail();
|
||||||
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
|
this.i18nService.t(
|
||||||
|
"areYouSureYouWantToEnableDeviceVerificationTheVerificationCodeEmailsWillArriveAtX",
|
||||||
|
email
|
||||||
|
),
|
||||||
|
this.i18nService.t("deviceVerification"),
|
||||||
|
this.i18nService.t("yes"),
|
||||||
|
this.i18nService.t("no"),
|
||||||
|
"warning"
|
||||||
|
);
|
||||||
|
if (!confirmed) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.formPromise = this.apiService.putDeviceVerificationSettings(
|
||||||
|
new DeviceVerificationRequest(this.enableDeviceVerification)
|
||||||
|
);
|
||||||
|
await this.formPromise;
|
||||||
|
this.platformUtilsService.showToast(
|
||||||
|
"success",
|
||||||
|
null,
|
||||||
|
this.i18nService.t("updatedDeviceVerification")
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
this.logService.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5069,5 +5069,26 @@
|
|||||||
},
|
},
|
||||||
"apiAccessToken": {
|
"apiAccessToken": {
|
||||||
"message": "API Access Token"
|
"message": "API Access Token"
|
||||||
|
},
|
||||||
|
"deviceVerification": {
|
||||||
|
"message": "Device Verification"
|
||||||
|
},
|
||||||
|
"enableDeviceVerification": {
|
||||||
|
"message": "Enable Device Verification"
|
||||||
|
},
|
||||||
|
"deviceVerificationDesc": {
|
||||||
|
"message": "When enabled, verification codes are sent to your email address when logging in from an unrecognized device"
|
||||||
|
},
|
||||||
|
"updatedDeviceVerification": {
|
||||||
|
"message": "Updated Device Verification"
|
||||||
|
},
|
||||||
|
"areYouSureYouWantToEnableDeviceVerificationTheVerificationCodeEmailsWillArriveAtX": {
|
||||||
|
"message": "Are you sure you want to enable Device Verification? The verification code emails will arrive at: $EMAIL$",
|
||||||
|
"placeholders": {
|
||||||
|
"email": {
|
||||||
|
"content": "$1",
|
||||||
|
"example": "My Email"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,14 +14,6 @@
|
|||||||
font-size: $font-size-base;
|
font-size: $font-size-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
a.create-organization-link {
|
|
||||||
&:hover {
|
|
||||||
@include themify($themes) {
|
|
||||||
color: themed("iconHover") !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
@extend .no-btn;
|
@extend .no-btn;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user