mirror of
https://github.com/bitwarden/browser
synced 2025-12-23 11:43:46 +00:00
[deps] Autofill: Update prettier to v3 (#7014)
* [deps] Autofill: Update prettier to v3 * prettier formatting updates --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Prusik <jprusik@classynemesis.com>
This commit is contained in:
@@ -45,7 +45,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
private organizationApiService: OrganizationApiServiceAbstraction,
|
||||
private organizationUserService: OrganizationUserService,
|
||||
private messagingService: MessagingService,
|
||||
private apiService: ApiService
|
||||
private apiService: ApiService,
|
||||
) {
|
||||
super(router, platformUtilsService, i18nService, route, stateService);
|
||||
}
|
||||
@@ -77,7 +77,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
initOrganization
|
||||
? this.i18nService.t("inviteInitAcceptedDesc")
|
||||
: this.i18nService.t("inviteAcceptedDesc"),
|
||||
{ timeout: 10000 }
|
||||
{ timeout: 10000 },
|
||||
);
|
||||
this.router.navigate(["/vault"]);
|
||||
}
|
||||
@@ -91,8 +91,8 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
this.organizationUserService.postOrganizationUserAcceptInit(
|
||||
qParams.organizationId,
|
||||
qParams.organizationUserId,
|
||||
request
|
||||
)
|
||||
request,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -101,13 +101,13 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
this.organizationUserService.postOrganizationUserAccept(
|
||||
qParams.organizationId,
|
||||
qParams.organizationUserId,
|
||||
request
|
||||
)
|
||||
request,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
private async prepareAcceptInitRequest(
|
||||
qParams: Params
|
||||
qParams: Params,
|
||||
): Promise<OrganizationUserAcceptInitRequest> {
|
||||
const request = new OrganizationUserAcceptInitRequest();
|
||||
request.token = qParams.token;
|
||||
@@ -116,13 +116,13 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
const [orgPublicKey, encryptedOrgPrivateKey] = await this.cryptoService.makeKeyPair(orgKey);
|
||||
const collection = await this.cryptoService.encrypt(
|
||||
this.i18nService.t("defaultCollection"),
|
||||
orgKey
|
||||
orgKey,
|
||||
);
|
||||
|
||||
request.key = encryptedOrgKey.encryptedString;
|
||||
request.keys = new OrganizationKeysRequest(
|
||||
orgPublicKey,
|
||||
encryptedOrgPrivateKey.encryptedString
|
||||
encryptedOrgPrivateKey.encryptedString,
|
||||
);
|
||||
request.collectionName = collection.encryptedString;
|
||||
|
||||
@@ -159,7 +159,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
qParams.organizationId,
|
||||
qParams.token,
|
||||
qParams.email,
|
||||
qParams.organizationUserId
|
||||
qParams.organizationUserId,
|
||||
);
|
||||
policyList = this.policyService.mapPoliciesFromToken(policies);
|
||||
} catch (e) {
|
||||
@@ -169,7 +169,7 @@ export class AcceptOrganizationComponent extends BaseAcceptComponent {
|
||||
if (policyList != null) {
|
||||
const result = this.policyService.getResetPasswordPolicyOptions(
|
||||
policyList,
|
||||
qParams.organizationId
|
||||
qParams.organizationId,
|
||||
);
|
||||
// Return true if policy enabled and auto-enroll enabled
|
||||
return result[1] && result[0].autoEnrollEnabled;
|
||||
|
||||
@@ -51,7 +51,7 @@ describe("RotateableKeySetService", () => {
|
||||
|
||||
function createSymmetricKey() {
|
||||
const key = Utils.fromB64ToArray(
|
||||
"1h-TuPwSbX5qoX0aVgjmda_Lfq85qAcKssBlXZnPIsQC3HNDGIecunYqXhJnp55QpdXRh-egJiLH3a0wqlVQsQ"
|
||||
"1h-TuPwSbX5qoX0aVgjmda_Lfq85qAcKssBlXZnPIsQC3HNDGIecunYqXhJnp55QpdXRh-egJiLH3a0wqlVQsQ",
|
||||
);
|
||||
return new SymmetricCryptoKey(key);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export class RotateableKeySetService {
|
||||
* @returns RotateableKeySet containing the current users `UserKey`
|
||||
*/
|
||||
async createKeySet<ExternalKey extends SymmetricCryptoKey>(
|
||||
externalKey: ExternalKey
|
||||
externalKey: ExternalKey,
|
||||
): Promise<RotateableKeySet<ExternalKey>> {
|
||||
const [publicKey, encryptedPrivateKey] = await this.cryptoService.makeKeyPair(externalKey);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class WebAuthnLoginAdminApiService {
|
||||
constructor(private apiService: ApiService) {}
|
||||
|
||||
async getCredentialCreateOptions(
|
||||
request: SecretVerificationRequest
|
||||
request: SecretVerificationRequest,
|
||||
): Promise<WebauthnLoginCredentialCreateOptionsResponse> {
|
||||
const response = await this.apiService.send("POST", "/webauthn/options", request, true, true);
|
||||
return new WebauthnLoginCredentialCreateOptionsResponse(response);
|
||||
|
||||
@@ -32,7 +32,7 @@ describe("WebauthnAdminService", () => {
|
||||
userVerificationService,
|
||||
rotateableKeySetService,
|
||||
webAuthnLoginPrfCryptoService,
|
||||
credentials
|
||||
credentials,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ export class WebauthnLoginAdminService {
|
||||
tap(() => this._loading$.next(true)),
|
||||
switchMap(() => this.fetchCredentials$()),
|
||||
tap(() => this._loading$.next(false)),
|
||||
shareReplay({ bufferSize: 1, refCount: true })
|
||||
shareReplay({ bufferSize: 1, refCount: true }),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ export class WebauthnLoginAdminService {
|
||||
private rotateableKeySetService: RotateableKeySetService,
|
||||
private webAuthnLoginPrfCryptoService: WebAuthnLoginPrfCryptoServiceAbstraction,
|
||||
@Optional() navigatorCredentials?: CredentialsContainer,
|
||||
@Optional() private logService?: LogService
|
||||
@Optional() private logService?: LogService,
|
||||
) {
|
||||
// Default parameters don't work when used with Angular DI
|
||||
this.navigatorCredentials = navigatorCredentials ?? navigator.credentials;
|
||||
@@ -60,7 +60,7 @@ export class WebauthnLoginAdminService {
|
||||
* @returns The credential attestation options and a token to be used for the credential creation request.
|
||||
*/
|
||||
async getCredentialCreateOptions(
|
||||
verification: Verification
|
||||
verification: Verification,
|
||||
): Promise<CredentialCreateOptionsView> {
|
||||
const request = await this.userVerificationService.buildRequest(verification);
|
||||
const response = await this.apiService.getCredentialCreateOptions(request);
|
||||
@@ -74,7 +74,7 @@ export class WebauthnLoginAdminService {
|
||||
* @returns A pending credential that can be saved to server directly or be used to create a key set.
|
||||
*/
|
||||
async createCredential(
|
||||
credentialOptions: CredentialCreateOptionsView
|
||||
credentialOptions: CredentialCreateOptionsView,
|
||||
): Promise<PendingWebauthnLoginCredentialView | undefined> {
|
||||
const nativeOptions: CredentialCreationOptions = {
|
||||
publicKey: credentialOptions.options,
|
||||
@@ -106,7 +106,7 @@ export class WebauthnLoginAdminService {
|
||||
* @returns A key set that can be saved to the server. Undefined is returned if the credential doesn't support PRF.
|
||||
*/
|
||||
async createKeySet(
|
||||
pendingCredential: PendingWebauthnLoginCredentialView
|
||||
pendingCredential: PendingWebauthnLoginCredentialView,
|
||||
): Promise<PrfKeySet | undefined> {
|
||||
const nativeOptions: CredentialRequestOptions = {
|
||||
publicKey: {
|
||||
@@ -136,9 +136,8 @@ export class WebauthnLoginAdminService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const symmetricPrfKey = await this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(
|
||||
prfResult
|
||||
);
|
||||
const symmetricPrfKey =
|
||||
await this.webAuthnLoginPrfCryptoService.createSymmetricKeyFromPrf(prfResult);
|
||||
return await this.rotateableKeySetService.createKeySet(symmetricPrfKey);
|
||||
} catch (error) {
|
||||
this.logService?.error(error);
|
||||
@@ -156,7 +155,7 @@ export class WebauthnLoginAdminService {
|
||||
async saveCredential(
|
||||
name: string,
|
||||
credential: PendingWebauthnLoginCredentialView,
|
||||
prfKeySet?: PrfKeySet
|
||||
prfKeySet?: PrfKeySet,
|
||||
) {
|
||||
const request = new SaveCredentialRequest();
|
||||
request.deviceResponse = new WebauthnLoginAttestationResponseRequest(credential.deviceResponse);
|
||||
@@ -193,7 +192,7 @@ export class WebauthnLoginAdminService {
|
||||
getCredential$(credentialId: string): Observable<WebauthnLoginCredentialView> {
|
||||
return this.credentials$.pipe(
|
||||
map((credentials) => credentials.find((c) => c.id === credentialId)),
|
||||
filter((c) => c !== undefined)
|
||||
filter((c) => c !== undefined),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -215,9 +214,9 @@ export class WebauthnLoginAdminService {
|
||||
map((response) =>
|
||||
response.data.map(
|
||||
(credential) =>
|
||||
new WebauthnLoginCredentialView(credential.id, credential.name, credential.prfStatus)
|
||||
)
|
||||
)
|
||||
new WebauthnLoginCredentialView(credential.id, credential.name, credential.prfStatus),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { ChallengeResponse } from "@bitwarden/common/auth/models/response/two-factor-web-authn.response";
|
||||
|
||||
export class CredentialCreateOptionsView {
|
||||
constructor(readonly options: ChallengeResponse, readonly token: string) {}
|
||||
constructor(
|
||||
readonly options: ChallengeResponse,
|
||||
readonly token: string,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ export class PendingWebauthnLoginCredentialView {
|
||||
constructor(
|
||||
readonly createOptions: CredentialCreateOptionsView,
|
||||
readonly deviceResponse: PublicKeyCredential,
|
||||
readonly supportsPrf: boolean
|
||||
readonly supportsPrf: boolean,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ export class WebauthnLoginCredentialView {
|
||||
constructor(
|
||||
readonly id: string,
|
||||
readonly name: string,
|
||||
readonly prfStatus: WebauthnLoginCredentialPrfStatus
|
||||
readonly prfStatus: WebauthnLoginCredentialPrfStatus,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
|
||||
i18nService: I18nService,
|
||||
route: ActivatedRoute,
|
||||
stateService: StateService,
|
||||
private emergencyAccessService: EmergencyAccessService
|
||||
private emergencyAccessService: EmergencyAccessService,
|
||||
) {
|
||||
super(router, platformUtilsService, i18nService, route, stateService);
|
||||
}
|
||||
@@ -40,7 +40,7 @@ export class AcceptEmergencyComponent extends BaseAcceptComponent {
|
||||
"success",
|
||||
this.i18nService.t("inviteAccepted"),
|
||||
this.i18nService.t("emergencyInviteAcceptedDesc"),
|
||||
{ timeout: 10000 }
|
||||
{ timeout: 10000 },
|
||||
);
|
||||
this.router.navigate(["/vault"]);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ export class EmergencyAccessApiService {
|
||||
"/emergency-access/" + id + "/policies",
|
||||
null,
|
||||
true,
|
||||
true
|
||||
true,
|
||||
);
|
||||
return new ListResponse(r, PolicyResponse);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ export class EmergencyAccessApiService {
|
||||
"/emergency-access/" + id + "/accept",
|
||||
request,
|
||||
true,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export class EmergencyAccessApiService {
|
||||
"/emergency-access/" + id + "/confirm",
|
||||
request,
|
||||
true,
|
||||
false
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,21 +100,21 @@ export class EmergencyAccessApiService {
|
||||
"/emergency-access/" + id + "/takeover",
|
||||
null,
|
||||
true,
|
||||
true
|
||||
true,
|
||||
);
|
||||
return new EmergencyAccessTakeoverResponse(r);
|
||||
}
|
||||
|
||||
async postEmergencyAccessPassword(
|
||||
id: string,
|
||||
request: EmergencyAccessPasswordRequest
|
||||
request: EmergencyAccessPasswordRequest,
|
||||
): Promise<void> {
|
||||
await this.apiService.send(
|
||||
"POST",
|
||||
"/emergency-access/" + id + "/password",
|
||||
request,
|
||||
true,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ export class EmergencyAccessApiService {
|
||||
"/emergency-access/" + id + "/view",
|
||||
null,
|
||||
true,
|
||||
true
|
||||
true,
|
||||
);
|
||||
return new EmergencyAccessViewResponse(r);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ describe("EmergencyAccessService", () => {
|
||||
cryptoService,
|
||||
encryptService,
|
||||
cipherService,
|
||||
logService
|
||||
logService,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ describe("EmergencyAccessService", () => {
|
||||
|
||||
const mockUserPublicKeyEncryptedUserKey = new EncString(
|
||||
EncryptionType.AesCbc256_HmacSha256_B64,
|
||||
"mockUserPublicKeyEncryptedUserKey"
|
||||
"mockUserPublicKeyEncryptedUserKey",
|
||||
);
|
||||
|
||||
cryptoService.getUserKey.mockResolvedValueOnce(mockUserKey);
|
||||
@@ -170,7 +170,7 @@ describe("EmergencyAccessService", () => {
|
||||
// where UserKey is the decrypted grantor user key
|
||||
const mockMasterKeyEncryptedUserKey = new EncString(
|
||||
EncryptionType.AesCbc256_HmacSha256_B64,
|
||||
"mockMasterKeyEncryptedUserKey"
|
||||
"mockMasterKeyEncryptedUserKey",
|
||||
);
|
||||
|
||||
const mockUserKey = new SymmetricCryptoKey(mockDecryptedGrantorUserKey) as UserKey;
|
||||
@@ -190,7 +190,7 @@ describe("EmergencyAccessService", () => {
|
||||
// Assert
|
||||
expect(emergencyAccessApiService.postEmergencyAccessPassword).toHaveBeenCalledWith(
|
||||
mockId,
|
||||
expectedEmergencyAccessPasswordRequest
|
||||
expectedEmergencyAccessPasswordRequest,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -203,7 +203,7 @@ describe("EmergencyAccessService", () => {
|
||||
} as EmergencyAccessTakeoverResponse);
|
||||
|
||||
await expect(
|
||||
emergencyAccessService.takeover(mockId, mockEmail, mockName)
|
||||
emergencyAccessService.takeover(mockId, mockEmail, mockName),
|
||||
).rejects.toThrowError("Failed to decrypt grantor key");
|
||||
|
||||
expect(emergencyAccessApiService.postEmergencyAccessPassword).not.toHaveBeenCalled();
|
||||
@@ -240,7 +240,7 @@ describe("EmergencyAccessService", () => {
|
||||
|
||||
cryptoService.rsaEncrypt.mockImplementation((plainValue, publicKey) => {
|
||||
return Promise.resolve(
|
||||
new EncString(EncryptionType.Rsa2048_OaepSha1_B64, "Encrypted: " + plainValue)
|
||||
new EncString(EncryptionType.Rsa2048_OaepSha1_B64, "Encrypted: " + plainValue),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -254,13 +254,13 @@ describe("EmergencyAccessService", () => {
|
||||
if (allowedStatuses.includes(emergencyAccess.status)) {
|
||||
expect(emergencyAccessApiService.putEmergencyAccess).toHaveBeenCalledWith(
|
||||
emergencyAccess.id,
|
||||
expect.any(EmergencyAccessUpdateRequest)
|
||||
expect.any(EmergencyAccessUpdateRequest),
|
||||
);
|
||||
expectedCallCount++;
|
||||
} else {
|
||||
expect(emergencyAccessApiService.putEmergencyAccess).not.toHaveBeenCalledWith(
|
||||
emergencyAccess.id,
|
||||
expect.any(EmergencyAccessUpdateRequest)
|
||||
expect.any(EmergencyAccessUpdateRequest),
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -272,7 +272,7 @@ describe("EmergencyAccessService", () => {
|
||||
function createMockEmergencyAccess(
|
||||
id: string,
|
||||
name: string,
|
||||
status: EmergencyAccessStatusType
|
||||
status: EmergencyAccessStatusType,
|
||||
): EmergencyAccessGranteeDetailsResponse {
|
||||
const emergencyAccess = new EmergencyAccessGranteeDetailsResponse({});
|
||||
emergencyAccess.id = id;
|
||||
|
||||
@@ -36,7 +36,7 @@ export class EmergencyAccessService {
|
||||
private cryptoService: CryptoService,
|
||||
private encryptService: EncryptService,
|
||||
private cipherService: CipherService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -148,7 +148,7 @@ export class EmergencyAccessService {
|
||||
try {
|
||||
this.logService.debug(
|
||||
"User's fingerprint: " +
|
||||
(await this.cryptoService.getFingerprint(granteeId, publicKey)).join("-")
|
||||
(await this.cryptoService.getFingerprint(granteeId, publicKey)).join("-"),
|
||||
);
|
||||
} catch {
|
||||
// Ignore errors since it's just a debug message
|
||||
@@ -208,7 +208,7 @@ export class EmergencyAccessService {
|
||||
|
||||
const ciphers = await this.encryptService.decryptItems(
|
||||
response.ciphers.map((c) => new Cipher(c)),
|
||||
grantorUserKey
|
||||
grantorUserKey,
|
||||
);
|
||||
return ciphers.sort(this.cipherService.getLocaleSortingFunction());
|
||||
}
|
||||
@@ -237,8 +237,8 @@ export class EmergencyAccessService {
|
||||
new KdfConfig(
|
||||
takeoverResponse.kdfIterations,
|
||||
takeoverResponse.kdfMemory,
|
||||
takeoverResponse.kdfParallelism
|
||||
)
|
||||
takeoverResponse.kdfParallelism,
|
||||
),
|
||||
);
|
||||
const masterKeyHash = await this.cryptoService.hashMasterKey(masterPassword, masterKey);
|
||||
|
||||
@@ -266,7 +266,7 @@ export class EmergencyAccessService {
|
||||
EmergencyAccessStatusType.RecoveryApproved,
|
||||
]);
|
||||
const filteredAccesses = existingEmergencyAccess.data.filter((d) =>
|
||||
allowedStatuses.has(d.status)
|
||||
allowedStatuses.has(d.status),
|
||||
);
|
||||
|
||||
for (const details of filteredAccesses) {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class HintComponent extends BaseHintComponent {
|
||||
apiService: ApiService,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService,
|
||||
loginService: LoginService
|
||||
loginService: LoginService,
|
||||
) {
|
||||
super(router, i18nService, apiService, platformUtilsService, logService, loginService);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<small class="text-muted form-text">
|
||||
{{ "loggedInAsEmailOn" | i18n : email : webVaultHostname }}
|
||||
{{ "loggedInAsEmailOn" | i18n: email : webVaultHostname }}
|
||||
</small>
|
||||
</div>
|
||||
<hr />
|
||||
|
||||
@@ -42,7 +42,7 @@ export class LockComponent extends BaseLockComponent {
|
||||
passwordStrengthService: PasswordStrengthServiceAbstraction,
|
||||
dialogService: DialogService,
|
||||
deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
|
||||
userVerificationService: UserVerificationService
|
||||
userVerificationService: UserVerificationService,
|
||||
) {
|
||||
super(
|
||||
router,
|
||||
@@ -62,7 +62,7 @@ export class LockComponent extends BaseLockComponent {
|
||||
passwordStrengthService,
|
||||
dialogService,
|
||||
deviceTrustCryptoService,
|
||||
userVerificationService
|
||||
userVerificationService,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ export class LoginViaAuthRequestComponent
|
||||
stateService: StateService,
|
||||
loginService: LoginService,
|
||||
deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
|
||||
authReqCryptoService: AuthRequestCryptoServiceAbstraction
|
||||
authReqCryptoService: AuthRequestCryptoServiceAbstraction,
|
||||
) {
|
||||
super(
|
||||
router,
|
||||
@@ -64,7 +64,7 @@ export class LoginViaAuthRequestComponent
|
||||
stateService,
|
||||
loginService,
|
||||
deviceTrustCryptoService,
|
||||
authReqCryptoService
|
||||
authReqCryptoService,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
formBuilder: FormBuilder,
|
||||
formValidationErrorService: FormValidationErrorsService,
|
||||
loginService: LoginService,
|
||||
webAuthnLoginService: WebAuthnLoginServiceAbstraction
|
||||
webAuthnLoginService: WebAuthnLoginServiceAbstraction,
|
||||
) {
|
||||
super(
|
||||
devicesApiService,
|
||||
@@ -83,7 +83,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
formValidationErrorService,
|
||||
route,
|
||||
loginService,
|
||||
webAuthnLoginService
|
||||
webAuthnLoginService,
|
||||
);
|
||||
this.onSuccessfulLogin = async () => {
|
||||
this.messagingService.send("setFullWidth");
|
||||
@@ -122,7 +122,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
invite.organizationId,
|
||||
invite.token,
|
||||
invite.email,
|
||||
invite.organizationUserId
|
||||
invite.organizationUserId,
|
||||
);
|
||||
policyList = this.policyService.mapPoliciesFromToken(this.policies);
|
||||
} catch (e) {
|
||||
@@ -132,7 +132,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
if (policyList != null) {
|
||||
const resetPasswordPolicy = this.policyService.getResetPasswordPolicyOptions(
|
||||
policyList,
|
||||
invite.organizationId
|
||||
invite.organizationId,
|
||||
);
|
||||
// Set to true if policy enabled and auto-enroll enabled
|
||||
this.showResetPasswordAutoEnrollWarning =
|
||||
@@ -155,7 +155,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
if (this.enforcedPasswordPolicyOptions != null) {
|
||||
const strengthResult = this.passwordStrengthService.getPasswordStrength(
|
||||
masterPassword,
|
||||
this.formGroup.value.email
|
||||
this.formGroup.value.email,
|
||||
);
|
||||
const masterPasswordScore = strengthResult == null ? null : strengthResult.score;
|
||||
|
||||
@@ -164,7 +164,7 @@ export class LoginComponent extends BaseLoginComponent implements OnInit {
|
||||
!this.policyService.evaluateMasterPassword(
|
||||
masterPasswordScore,
|
||||
masterPassword,
|
||||
this.enforcedPasswordPolicyOptions
|
||||
this.enforcedPasswordPolicyOptions,
|
||||
)
|
||||
) {
|
||||
const policiesData: { [id: string]: PolicyData } = {};
|
||||
|
||||
@@ -31,7 +31,7 @@ export class MigrateFromLegacyEncryptionComponent {
|
||||
private migrationService: MigrateFromLegacyEncryptionService,
|
||||
private cryptoService: CryptoService,
|
||||
private messagingService: MessagingService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
submit = async () => {
|
||||
@@ -51,9 +51,8 @@ export class MigrateFromLegacyEncryptionComponent {
|
||||
|
||||
try {
|
||||
// Create new user key
|
||||
const [newUserKey, masterKeyEncUserKey] = await this.migrationService.createNewUserKey(
|
||||
masterPassword
|
||||
);
|
||||
const [newUserKey, masterKeyEncUserKey] =
|
||||
await this.migrationService.createNewUserKey(masterPassword);
|
||||
|
||||
// Update admin recover keys
|
||||
await this.migrationService.updateAllAdminRecoveryKeys(masterPassword, newUserKey);
|
||||
@@ -65,14 +64,14 @@ export class MigrateFromLegacyEncryptionComponent {
|
||||
await this.migrationService.updateKeysAndEncryptedData(
|
||||
masterPassword,
|
||||
newUserKey,
|
||||
masterKeyEncUserKey
|
||||
masterKeyEncUserKey,
|
||||
);
|
||||
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
this.i18nService.t("keyUpdated"),
|
||||
this.i18nService.t("logBackInOthersToo"),
|
||||
{ timeout: 15000 }
|
||||
{ timeout: 15000 },
|
||||
);
|
||||
this.messagingService.send("logout");
|
||||
} catch (e) {
|
||||
|
||||
@@ -66,7 +66,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
cipherService,
|
||||
folderService,
|
||||
sendService,
|
||||
stateService
|
||||
stateService,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
cryptoService.isLegacyUser.mockResolvedValue(false);
|
||||
|
||||
await expect(
|
||||
migrateFromLegacyEncryptionService.createNewUserKey(mockMasterPassword)
|
||||
migrateFromLegacyEncryptionService.createNewUserKey(mockMasterPassword),
|
||||
).rejects.toThrowError("Invalid master password or user may not be legacy");
|
||||
});
|
||||
});
|
||||
@@ -109,7 +109,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
|
||||
cryptoService.getPrivateKey.mockResolvedValue(new Uint8Array(64) as CsprngArray);
|
||||
cryptoService.rsaEncrypt.mockResolvedValue(
|
||||
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted")
|
||||
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted"),
|
||||
);
|
||||
|
||||
folderViews = new BehaviorSubject<FolderView[]>(mockFolders);
|
||||
@@ -122,7 +122,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
|
||||
encryptService.encrypt.mockImplementation((plainValue, userKey) => {
|
||||
return Promise.resolve(
|
||||
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted: " + plainValue)
|
||||
new EncString(EncryptionType.AesCbc256_HmacSha256_B64, "Encrypted: " + plainValue),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -131,7 +131,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
encryptedFolder.id = folder.id;
|
||||
encryptedFolder.name = new EncString(
|
||||
EncryptionType.AesCbc256_HmacSha256_B64,
|
||||
"Encrypted: " + folder.name
|
||||
"Encrypted: " + folder.name,
|
||||
);
|
||||
return Promise.resolve(encryptedFolder);
|
||||
});
|
||||
@@ -141,7 +141,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
encryptedCipher.id = cipher.id;
|
||||
encryptedCipher.name = new EncString(
|
||||
EncryptionType.AesCbc256_HmacSha256_B64,
|
||||
"Encrypted: " + cipher.name
|
||||
"Encrypted: " + cipher.name,
|
||||
);
|
||||
return Promise.resolve(encryptedCipher);
|
||||
});
|
||||
@@ -151,7 +151,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
await migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
|
||||
mockMasterPassword,
|
||||
mockUserKey,
|
||||
mockEncUserKey
|
||||
mockEncUserKey,
|
||||
);
|
||||
|
||||
expect(cryptoService.getOrDeriveMasterKey).toHaveBeenCalled();
|
||||
@@ -161,7 +161,7 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
await migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
|
||||
mockMasterPassword,
|
||||
mockUserKey,
|
||||
mockEncUserKey
|
||||
mockEncUserKey,
|
||||
);
|
||||
expect(syncService.fullSync).toHaveBeenCalledWith(true);
|
||||
});
|
||||
@@ -173,8 +173,8 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
|
||||
mockMasterPassword,
|
||||
mockUserKey,
|
||||
mockEncUserKey
|
||||
)
|
||||
mockEncUserKey,
|
||||
),
|
||||
).rejects.toThrowError("sync failed");
|
||||
|
||||
expect(apiService.postAccountKey).not.toHaveBeenCalled();
|
||||
@@ -189,8 +189,8 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
migrateFromLegacyEncryptionService.updateKeysAndEncryptedData(
|
||||
mockMasterPassword,
|
||||
mockUserKey,
|
||||
mockEncUserKey
|
||||
)
|
||||
mockEncUserKey,
|
||||
),
|
||||
).rejects.toThrowError("Ciphers failed to be retrieved");
|
||||
|
||||
expect(apiService.postAccountKey).not.toHaveBeenCalled();
|
||||
@@ -240,36 +240,36 @@ describe("migrateFromLegacyEncryptionService", () => {
|
||||
it("Only updates organizations that are enrolled in admin recovery", async () => {
|
||||
await migrateFromLegacyEncryptionService.updateAllAdminRecoveryKeys(
|
||||
mockMasterPassword,
|
||||
mockUserKey
|
||||
mockUserKey,
|
||||
);
|
||||
|
||||
expect(
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment,
|
||||
).toHaveBeenCalledWith(
|
||||
"1",
|
||||
expect.any(String),
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
|
||||
);
|
||||
expect(
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment,
|
||||
).toHaveBeenCalledWith(
|
||||
"2",
|
||||
expect.any(String),
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
|
||||
);
|
||||
expect(
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment,
|
||||
).not.toHaveBeenCalledWith(
|
||||
"3",
|
||||
expect.any(String),
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
|
||||
);
|
||||
expect(
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment
|
||||
organizationUserService.putOrganizationUserResetPasswordEnrollment,
|
||||
).not.toHaveBeenCalledWith(
|
||||
"4",
|
||||
expect.any(String),
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest)
|
||||
expect.any(OrganizationUserResetPasswordEnrollmentRequest),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ export class MigrateFromLegacyEncryptionService {
|
||||
private cipherService: CipherService,
|
||||
private folderService: FolderService,
|
||||
private sendService: SendService,
|
||||
private stateService: StateService
|
||||
private stateService: StateService,
|
||||
) {}
|
||||
|
||||
/**
|
||||
@@ -51,7 +51,7 @@ export class MigrateFromLegacyEncryptionService {
|
||||
masterPassword,
|
||||
await this.stateService.getEmail(),
|
||||
await this.stateService.getKdfType(),
|
||||
await this.stateService.getKdfConfig()
|
||||
await this.stateService.getKdfConfig(),
|
||||
);
|
||||
|
||||
if (!masterKey) {
|
||||
@@ -77,14 +77,14 @@ export class MigrateFromLegacyEncryptionService {
|
||||
async updateKeysAndEncryptedData(
|
||||
masterPassword: string,
|
||||
newUserKey: UserKey,
|
||||
newEncUserKey: EncString
|
||||
newEncUserKey: EncString,
|
||||
): Promise<void> {
|
||||
// Create new request and add master key and hash
|
||||
const request = new UpdateKeyRequest();
|
||||
request.key = newEncUserKey.encryptedString;
|
||||
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
|
||||
masterPassword,
|
||||
await this.cryptoService.getOrDeriveMasterKey(masterPassword)
|
||||
await this.cryptoService.getOrDeriveMasterKey(masterPassword),
|
||||
);
|
||||
|
||||
// Sync before encrypting to make sure we have latest data
|
||||
@@ -132,13 +132,13 @@ export class MigrateFromLegacyEncryptionService {
|
||||
request.resetPasswordKey = encryptedKey.encryptedString;
|
||||
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
|
||||
masterPassword,
|
||||
await this.cryptoService.getOrDeriveMasterKey(masterPassword)
|
||||
await this.cryptoService.getOrDeriveMasterKey(masterPassword),
|
||||
);
|
||||
|
||||
await this.organizationUserService.putOrganizationUserResetPasswordEnrollment(
|
||||
org.id,
|
||||
org.userId,
|
||||
request
|
||||
request,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export class MigrateFromLegacyEncryptionService {
|
||||
folders.map(async (folder) => {
|
||||
const encryptedFolder = await this.folderService.encrypt(folder, newUserKey);
|
||||
return new FolderWithIdRequest(encryptedFolder);
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ export class MigrateFromLegacyEncryptionService {
|
||||
ciphers.map(async (cipher) => {
|
||||
const encryptedCipher = await this.cipherService.encrypt(cipher, newUserKey);
|
||||
return new CipherWithIdRequest(encryptedCipher);
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ export class MigrateFromLegacyEncryptionService {
|
||||
const sendKey = await this.encryptService.decryptToBytes(send.key, null);
|
||||
send.key = (await this.encryptService.encrypt(sendKey, newUserKey)) ?? send.key;
|
||||
return new SendWithIdRequest(send);
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class RecoverDeleteComponent {
|
||||
private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
async submit() {
|
||||
@@ -32,7 +32,7 @@ export class RecoverDeleteComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("deleteRecoverEmailSent")
|
||||
this.i18nService.t("deleteRecoverEmailSent"),
|
||||
);
|
||||
this.router.navigate(["/"]);
|
||||
} catch (e) {
|
||||
|
||||
@@ -26,7 +26,7 @@ export class RecoverTwoFactorComponent {
|
||||
private i18nService: I18nService,
|
||||
private cryptoService: CryptoService,
|
||||
private authService: AuthService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
async submit() {
|
||||
@@ -41,7 +41,7 @@ export class RecoverTwoFactorComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("twoStepRecoverDisabled")
|
||||
this.i18nService.t("twoStepRecoverDisabled"),
|
||||
);
|
||||
this.router.navigate(["/"]);
|
||||
} catch (e) {
|
||||
|
||||
@@ -46,7 +46,7 @@ export class RegisterFormComponent extends BaseRegisterComponent {
|
||||
environmentService: EnvironmentService,
|
||||
logService: LogService,
|
||||
auditService: AuditService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
formValidationErrorService,
|
||||
@@ -62,7 +62,7 @@ export class RegisterFormComponent extends BaseRegisterComponent {
|
||||
environmentService,
|
||||
logService,
|
||||
auditService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -87,13 +87,13 @@ export class RegisterFormComponent extends BaseRegisterComponent {
|
||||
!this.policyService.evaluateMasterPassword(
|
||||
this.passwordStrengthResult.score,
|
||||
this.formGroup.value.masterPassword,
|
||||
this.enforcedPolicyOptions
|
||||
this.enforcedPolicyOptions,
|
||||
)
|
||||
) {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("masterPasswordPolicyRequirementsNotMet")
|
||||
this.i18nService.t("masterPasswordPolicyRequirementsNotMet"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<hr />
|
||||
<div class="card d-block">
|
||||
<div class="card-body">
|
||||
<p>{{ "convertOrganizationEncryptionDesc" | i18n : organization.name }}</p>
|
||||
<p>{{ "convertOrganizationEncryptionDesc" | i18n: organization.name }}</p>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -36,7 +36,7 @@ export class SetPasswordComponent extends BaseSetPasswordComponent {
|
||||
stateService: StateService,
|
||||
organizationApiService: OrganizationApiServiceAbstraction,
|
||||
organizationUserService: OrganizationUserService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
i18nService,
|
||||
@@ -53,7 +53,7 @@ export class SetPasswordComponent extends BaseSetPasswordComponent {
|
||||
stateService,
|
||||
organizationApiService,
|
||||
organizationUserService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
dialogService: DialogService,
|
||||
private userVerificationService: UserVerificationService,
|
||||
private deviceTrustCryptoService: DeviceTrustCryptoServiceAbstraction,
|
||||
private configService: ConfigServiceAbstraction
|
||||
private configService: ConfigServiceAbstraction,
|
||||
) {
|
||||
super(
|
||||
i18nService,
|
||||
@@ -81,13 +81,13 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
platformUtilsService,
|
||||
policyService,
|
||||
stateService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
async ngOnInit() {
|
||||
this.showWebauthnLoginSettings$ = this.configService.getFeatureFlag$(
|
||||
FeatureFlag.PasswordlessLogin
|
||||
FeatureFlag.PasswordlessLogin,
|
||||
);
|
||||
|
||||
if (!(await this.userVerificationService.hasMasterPassword())) {
|
||||
@@ -124,7 +124,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
|
||||
if (learnMore) {
|
||||
this.platformUtilsService.launchUri(
|
||||
"https://bitwarden.com/help/attachments/#add-storage-space"
|
||||
"https://bitwarden.com/help/attachments/#add-storage-space",
|
||||
);
|
||||
}
|
||||
this.rotateUserKey = false;
|
||||
@@ -153,7 +153,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("hintEqualsPassword")
|
||||
this.i18nService.t("hintEqualsPassword"),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("masterPasswordRequired")
|
||||
this.i18nService.t("masterPasswordRequired"),
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -186,13 +186,13 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
async performSubmitActions(
|
||||
newMasterPasswordHash: string,
|
||||
newMasterKey: MasterKey,
|
||||
newUserKey: [UserKey, EncString]
|
||||
newUserKey: [UserKey, EncString],
|
||||
) {
|
||||
const masterKey = await this.cryptoService.getOrDeriveMasterKey(this.currentMasterPassword);
|
||||
const request = new PasswordRequest();
|
||||
request.masterPasswordHash = await this.cryptoService.hashMasterKey(
|
||||
this.currentMasterPassword,
|
||||
masterKey
|
||||
masterKey,
|
||||
);
|
||||
request.masterPasswordHint = this.masterPasswordHint;
|
||||
request.newMasterPasswordHash = newMasterPasswordHash;
|
||||
@@ -212,7 +212,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
this.i18nService.t("masterPasswordChanged"),
|
||||
this.i18nService.t("logBackIn")
|
||||
this.i18nService.t("logBackIn"),
|
||||
);
|
||||
this.messagingService.send("logout");
|
||||
} catch {
|
||||
@@ -257,7 +257,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
const sendKey = await this.cryptoService.decryptToBytes(send.key, null);
|
||||
send.key = (await this.cryptoService.encrypt(sendKey, newUserKey)) ?? send.key;
|
||||
request.sends.push(new SendWithIdRequest(send));
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
await this.deviceTrustCryptoService.rotateDevicesTrust(newUserKey, masterPasswordHash);
|
||||
@@ -293,7 +293,7 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent {
|
||||
await this.organizationUserService.putOrganizationUserResetPasswordEnrollment(
|
||||
org.id,
|
||||
org.userId,
|
||||
request
|
||||
request,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class DeauthorizeSessionsComponent {
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private userVerificationService: UserVerificationService,
|
||||
private messagingService: MessagingService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
async submit() {
|
||||
@@ -34,7 +34,7 @@ export class DeauthorizeSessionsComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
this.i18nService.t("sessionsDeauthorized"),
|
||||
this.i18nService.t("logBackIn")
|
||||
this.i18nService.t("logBackIn"),
|
||||
);
|
||||
this.messagingService.send("logout");
|
||||
} catch (e) {
|
||||
|
||||
@@ -29,7 +29,7 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen
|
||||
apiService: ApiService,
|
||||
logService: LogService,
|
||||
fileDownloadService: FileDownloadService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
cipherService,
|
||||
@@ -41,7 +41,7 @@ export class EmergencyAccessAttachmentsComponent extends BaseAttachmentsComponen
|
||||
logService,
|
||||
stateService,
|
||||
fileDownloadService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export class EmergencyAccessConfirmComponent implements OnInit {
|
||||
private apiService: ApiService,
|
||||
private cryptoService: CryptoService,
|
||||
private stateService: StateService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
|
||||
@@ -34,7 +34,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
|
||||
private emergencyAccessService: EmergencyAccessService,
|
||||
private i18nService: I18nService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -54,7 +54,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
|
||||
this.title = this.i18nService.t("editEmergencyContact");
|
||||
try {
|
||||
const emergencyAccess = await this.emergencyAccessService.getEmergencyAccess(
|
||||
this.emergencyAccessId
|
||||
this.emergencyAccessId,
|
||||
);
|
||||
this.type = emergencyAccess.type;
|
||||
this.waitTime = emergencyAccess.waitTimeDays;
|
||||
@@ -81,7 +81,7 @@ export class EmergencyAccessAddEditComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.name)
|
||||
this.i18nService.t(this.editMode ? "editedUserId" : "invitedUsers", this.name),
|
||||
);
|
||||
this.onSaved.emit();
|
||||
} catch (e) {
|
||||
|
||||
@@ -53,7 +53,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
private logService: LogService,
|
||||
private stateService: StateService,
|
||||
private organizationService: OrganizationService,
|
||||
protected dialogService: DialogService
|
||||
protected dialogService: DialogService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -94,7 +94,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
modal.close();
|
||||
this.remove(details);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("hasBeenReinvited", contact.email)
|
||||
this.i18nService.t("hasBeenReinvited", contact.email),
|
||||
);
|
||||
this.actionPromise = null;
|
||||
}
|
||||
@@ -145,10 +145,10 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(contact))
|
||||
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(contact)),
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(contact))
|
||||
this.i18nService.t("hasBeenConfirmed", this.userNamePipe.transform(contact)),
|
||||
);
|
||||
this.actionPromise = null;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("removedUserId", this.userNamePipe.transform(details))
|
||||
this.i18nService.t("removedUserId", this.userNamePipe.transform(details)),
|
||||
);
|
||||
|
||||
if (details instanceof GranteeEmergencyAccess) {
|
||||
@@ -215,13 +215,13 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("requestSent", this.userNamePipe.transform(details))
|
||||
this.i18nService.t("requestSent", this.userNamePipe.transform(details)),
|
||||
);
|
||||
}
|
||||
|
||||
async approve(details: GranteeEmergencyAccess) {
|
||||
const type = this.i18nService.t(
|
||||
details.type === EmergencyAccessType.View ? "view" : "takeover"
|
||||
details.type === EmergencyAccessType.View ? "view" : "takeover",
|
||||
);
|
||||
|
||||
const confirmed = await this.dialogService.openSimpleDialog({
|
||||
@@ -244,7 +244,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("emergencyApproved", this.userNamePipe.transform(details))
|
||||
this.i18nService.t("emergencyApproved", this.userNamePipe.transform(details)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("emergencyRejected", this.userNamePipe.transform(details))
|
||||
this.i18nService.t("emergencyRejected", this.userNamePipe.transform(details)),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -274,10 +274,10 @@ export class EmergencyAccessComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("passwordResetFor", this.userNamePipe.transform(details))
|
||||
this.i18nService.t("passwordResetFor", this.userNamePipe.transform(details)),
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class EmergencyAccessTakeoverComponent
|
||||
policyService: PolicyService,
|
||||
private emergencyAccessService: EmergencyAccessService,
|
||||
private logService: LogService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
i18nService,
|
||||
@@ -53,7 +53,7 @@ export class EmergencyAccessTakeoverComponent
|
||||
platformUtilsService,
|
||||
policyService,
|
||||
stateService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ export class EmergencyAccessTakeoverComponent
|
||||
await this.emergencyAccessService.takeover(
|
||||
this.emergencyAccessId,
|
||||
this.masterPassword,
|
||||
this.email
|
||||
this.email,
|
||||
);
|
||||
this.onDone.emit();
|
||||
} catch (e) {
|
||||
@@ -87,7 +87,7 @@ export class EmergencyAccessTakeoverComponent
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("errorOccurred"),
|
||||
this.i18nService.t("unexpectedError")
|
||||
this.i18nService.t("unexpectedError"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ export class EmergencyAccessViewComponent implements OnInit {
|
||||
private modalService: ModalService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private emergencyAccessService: EmergencyAccessService
|
||||
private emergencyAccessService: EmergencyAccessService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -52,7 +52,7 @@ export class EmergencyAccessViewComponent implements OnInit {
|
||||
(comp) => {
|
||||
comp.cipherId = cipher == null ? null : cipher.id;
|
||||
comp.cipher = cipher;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return childComponent;
|
||||
@@ -70,7 +70,7 @@ export class EmergencyAccessViewComponent implements OnInit {
|
||||
(comp) => {
|
||||
comp.cipher = cipher;
|
||||
comp.emergencyAccessId = this.id;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export class EmergencyAddEditCipherComponent extends BaseAddEditComponent {
|
||||
logService: LogService,
|
||||
sendApiService: SendApiService,
|
||||
dialogService: DialogService,
|
||||
datePipe: DatePipe
|
||||
datePipe: DatePipe,
|
||||
) {
|
||||
super(
|
||||
cipherService,
|
||||
@@ -69,7 +69,7 @@ export class EmergencyAddEditCipherComponent extends BaseAddEditComponent {
|
||||
passwordRepromptService,
|
||||
sendApiService,
|
||||
dialogService,
|
||||
datePipe
|
||||
datePipe,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export class TwoFactorAuthenticatorComponent
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService,
|
||||
private stateService: StateService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -60,7 +60,7 @@ export class TwoFactorAuthenticatorComponent
|
||||
platformUtilsService,
|
||||
logService,
|
||||
userVerificationService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
this.qrScript = window.document.createElement("script");
|
||||
this.qrScript.src = "scripts/qrious.min.js";
|
||||
|
||||
@@ -32,7 +32,7 @@ export abstract class TwoFactorBaseComponent {
|
||||
protected platformUtilsService: PlatformUtilsService,
|
||||
protected logService: LogService,
|
||||
protected userVerificationService: UserVerificationService,
|
||||
protected dialogService: DialogService
|
||||
protected dialogService: DialogService,
|
||||
) {}
|
||||
|
||||
protected auth(authResponse: AuthResponseBase) {
|
||||
@@ -79,7 +79,7 @@ export abstract class TwoFactorBaseComponent {
|
||||
}
|
||||
|
||||
protected async buildRequestModel<T extends SecretVerificationRequest>(
|
||||
requestClass: new () => T
|
||||
requestClass: new () => T,
|
||||
) {
|
||||
return this.userVerificationService.buildRequest(
|
||||
{
|
||||
@@ -87,7 +87,7 @@ export abstract class TwoFactorBaseComponent {
|
||||
type: this.verificationType,
|
||||
},
|
||||
requestClass,
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService,
|
||||
userVerificationService: UserVerificationService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -40,7 +40,7 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService,
|
||||
logService,
|
||||
userVerificationService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ export class TwoFactorDuoComponent extends TwoFactorBaseComponent {
|
||||
if (this.organizationId != null) {
|
||||
this.formPromise = this.apiService.putTwoFactorOrganizationDuo(
|
||||
this.organizationId,
|
||||
request
|
||||
request,
|
||||
);
|
||||
} else {
|
||||
this.formPromise = this.apiService.putTwoFactorDuo(request);
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<span>{{ "sendEmail" | i18n }}</span>
|
||||
</button>
|
||||
<span class="text-success ml-3" *ngIf="sentEmail">
|
||||
{{ "verificationCodeEmailSent" | i18n : sentEmail }}
|
||||
{{ "verificationCodeEmailSent" | i18n: sentEmail }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -36,7 +36,7 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
|
||||
logService: LogService,
|
||||
userVerificationService: UserVerificationService,
|
||||
private stateService: StateService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -44,7 +44,7 @@ export class TwoFactorEmailComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService,
|
||||
logService,
|
||||
userVerificationService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ export class TwoFactorRecoveryComponent {
|
||||
"</code></div>" +
|
||||
'<p style="text-align: center;">' +
|
||||
new Date() +
|
||||
"</p>"
|
||||
"</p>",
|
||||
);
|
||||
w.onafterprint = () => w.close();
|
||||
w.print();
|
||||
|
||||
@@ -56,7 +56,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
protected modalService: ModalService,
|
||||
protected messagingService: MessagingService,
|
||||
protected policyService: PolicyService,
|
||||
private stateService: StateService
|
||||
private stateService: StateService,
|
||||
) {}
|
||||
|
||||
async ngOnInit() {
|
||||
@@ -119,7 +119,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
case TwoFactorProviderType.Authenticator: {
|
||||
const authComp = await this.openModal(
|
||||
this.authenticatorModalRef,
|
||||
TwoFactorAuthenticatorComponent
|
||||
TwoFactorAuthenticatorComponent,
|
||||
);
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
authComp.onUpdated.subscribe((enabled: boolean) => {
|
||||
@@ -154,7 +154,7 @@ export class TwoFactorSetupComponent implements OnInit, OnDestroy {
|
||||
case TwoFactorProviderType.WebAuthn: {
|
||||
const webAuthnComp = await this.openModal(
|
||||
this.webAuthnModalRef,
|
||||
TwoFactorWebAuthnComponent
|
||||
TwoFactorWebAuthnComponent,
|
||||
);
|
||||
// eslint-disable-next-line rxjs-angular/prefer-takeuntil
|
||||
webAuthnComp.onUpdated.subscribe((enabled: boolean) => {
|
||||
|
||||
@@ -25,7 +25,7 @@ export class TwoFactorVerifyComponent {
|
||||
constructor(
|
||||
private apiService: ApiService,
|
||||
private logService: LogService,
|
||||
private userVerificationService: UserVerificationService
|
||||
private userVerificationService: UserVerificationService,
|
||||
) {}
|
||||
|
||||
async submit() {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
[appApiAction]="k.removePromise"
|
||||
>
|
||||
<i class="bwi bwi-li bwi-key"></i>
|
||||
<strong *ngIf="!k.configured || !k.name">{{ "webAuthnkeyX" | i18n : i + 1 }}</strong>
|
||||
<strong *ngIf="!k.configured || !k.name">{{ "webAuthnkeyX" | i18n: i + 1 }}</strong>
|
||||
<strong *ngIf="k.configured && k.name">{{ k.name }}</strong>
|
||||
<ng-container *ngIf="k.configured && !$any(removeKeyBtn).loading">
|
||||
<ng-container *ngIf="k.migrated">
|
||||
|
||||
@@ -51,7 +51,7 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
|
||||
private ngZone: NgZone,
|
||||
logService: LogService,
|
||||
userVerificationService: UserVerificationService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -59,7 +59,7 @@ export class TwoFactorWebAuthnComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService,
|
||||
logService,
|
||||
userVerificationService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="form-group col-6" *ngFor="let k of keys; let i = index">
|
||||
<label for="key{{ i + 1 }}">{{ "yubikeyX" | i18n : i + 1 }}</label>
|
||||
<label for="key{{ i + 1 }}">{{ "yubikeyX" | i18n: i + 1 }}</label>
|
||||
<input
|
||||
id="key{{ i + 1 }}"
|
||||
type="password"
|
||||
|
||||
@@ -38,7 +38,7 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
logService: LogService,
|
||||
userVerificationService: UserVerificationService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
apiService,
|
||||
@@ -46,7 +46,7 @@ export class TwoFactorYubiKeyComponent extends TwoFactorBaseComponent {
|
||||
platformUtilsService,
|
||||
logService,
|
||||
userVerificationService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class VerifyEmailComponent {
|
||||
private i18nService: I18nService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private logService: LogService,
|
||||
private tokenService: TokenService
|
||||
private tokenService: TokenService,
|
||||
) {}
|
||||
|
||||
async verifyEmail(): Promise<void> {
|
||||
@@ -35,7 +35,7 @@ export class VerifyEmailComponent {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("checkInboxForVerification")
|
||||
this.i18nService.t("checkInboxForVerification"),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<input type="text" bitInput formControlName="name" appAutofocus />
|
||||
<bit-hint>{{
|
||||
"charactersCurrentAndMaximum"
|
||||
| i18n : formGroup.value.credentialNaming.name.length : NameMaxCharacters
|
||||
| i18n: formGroup.value.credentialNaming.name.length : NameMaxCharacters
|
||||
}}</bit-hint>
|
||||
</bit-form-field>
|
||||
<bit-form-control *ngIf="pendingCredential?.supportsPrf" class="!tw-mb-0 tw-mt-6">
|
||||
|
||||
@@ -59,7 +59,7 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
private webauthnService: WebauthnLoginAdminService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -95,7 +95,7 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
|
||||
try {
|
||||
this.credentialOptions = await this.webauthnService.getCredentialCreateOptions(
|
||||
this.formGroup.value.userVerification.secret
|
||||
this.formGroup.value.userVerification.secret,
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof ErrorResponse && error.statusCode === 400) {
|
||||
@@ -105,7 +105,7 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("unexpectedError"),
|
||||
error.message
|
||||
error.message,
|
||||
);
|
||||
}
|
||||
return;
|
||||
@@ -155,20 +155,20 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
await this.webauthnService.saveCredential(
|
||||
this.formGroup.value.credentialNaming.name,
|
||||
this.pendingCredential,
|
||||
keySet
|
||||
keySet,
|
||||
);
|
||||
|
||||
if (await firstValueFrom(this.hasPasskeys$)) {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("passkeySaved", name)
|
||||
this.i18nService.t("passkeySaved", name),
|
||||
);
|
||||
} else {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
null,
|
||||
this.i18nService.t("loginWithPasskeyEnabled")
|
||||
this.i18nService.t("loginWithPasskeyEnabled"),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -183,10 +183,10 @@ export class CreateCredentialDialogComponent implements OnInit {
|
||||
*/
|
||||
export const openCreateCredentialDialog = (
|
||||
dialogService: DialogService,
|
||||
config: DialogConfig<unknown>
|
||||
config: DialogConfig<unknown>,
|
||||
) => {
|
||||
return dialogService.open<CreateCredentialDialogResult | undefined, unknown>(
|
||||
CreateCredentialDialogComponent,
|
||||
config
|
||||
config,
|
||||
);
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ export class DeleteCredentialDialogComponent implements OnInit, OnDestroy {
|
||||
private webauthnService: WebauthnLoginAdminService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -64,7 +64,7 @@ export class DeleteCredentialDialogComponent implements OnInit, OnDestroy {
|
||||
this.platformUtilsService.showToast(
|
||||
"error",
|
||||
this.i18nService.t("unexpectedError"),
|
||||
error.message
|
||||
error.message,
|
||||
);
|
||||
}
|
||||
return false;
|
||||
@@ -88,7 +88,7 @@ export class DeleteCredentialDialogComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
export const openDeleteCredentialDialogComponent = (
|
||||
dialogService: DialogService,
|
||||
config: DialogConfig<DeleteCredentialDialogParams>
|
||||
config: DialogConfig<DeleteCredentialDialogParams>,
|
||||
) => {
|
||||
return dialogService.open<unknown>(DeleteCredentialDialogComponent, config);
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ export class WebauthnLoginSettingsComponent implements OnInit, OnDestroy {
|
||||
constructor(
|
||||
private webauthnService: WebauthnLoginAdminService,
|
||||
private dialogService: DialogService,
|
||||
private policyService: PolicyService
|
||||
private policyService: PolicyService,
|
||||
) {}
|
||||
|
||||
@HostBinding("attr.aria-busy")
|
||||
|
||||
@@ -25,7 +25,7 @@ export class UserVerificationPromptComponent extends BaseUserVerificationPrompt
|
||||
userVerificationService: UserVerificationService,
|
||||
formBuilder: FormBuilder,
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
i18nService: I18nService
|
||||
i18nService: I18nService,
|
||||
) {
|
||||
// TODO: Remove when BaseUserVerificationPrompt has support for CL
|
||||
const modalConfig: ModalConfig = { data };
|
||||
@@ -35,7 +35,7 @@ export class UserVerificationPromptComponent extends BaseUserVerificationPrompt
|
||||
userVerificationService,
|
||||
formBuilder,
|
||||
platformUtilsService,
|
||||
i18nService
|
||||
i18nService,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,10 +51,10 @@ export class UserVerificationPromptComponent extends BaseUserVerificationPrompt
|
||||
*/
|
||||
export const openUserVerificationPrompt = (
|
||||
dialogService: DialogService,
|
||||
config: DialogConfig<UserVerificationPromptParams>
|
||||
config: DialogConfig<UserVerificationPromptParams>,
|
||||
) => {
|
||||
return dialogService.open<boolean, UserVerificationPromptParams>(
|
||||
UserVerificationPromptComponent,
|
||||
config
|
||||
config,
|
||||
);
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
logService: LogService,
|
||||
private orgDomainApiService: OrgDomainApiServiceAbstraction,
|
||||
private validationService: ValidationService,
|
||||
configService: ConfigServiceAbstraction
|
||||
configService: ConfigServiceAbstraction,
|
||||
) {
|
||||
super(
|
||||
authService,
|
||||
@@ -53,7 +53,7 @@ export class SsoComponent extends BaseSsoComponent {
|
||||
environmentService,
|
||||
passwordGenerationService,
|
||||
logService,
|
||||
configService
|
||||
configService,
|
||||
);
|
||||
this.redirectUri = window.location.origin + "/sso-connector.html";
|
||||
this.clientId = "web";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="tw-pb-6 tw-pl-6">
|
||||
<p class="tw-text-xl">{{ "trialThankYou" | i18n : orgLabel }}</p>
|
||||
<p class="tw-text-xl">{{ "trialThankYou" | i18n: orgLabel }}</p>
|
||||
<ul class="tw-list-disc">
|
||||
<li>
|
||||
<p>
|
||||
@@ -10,7 +10,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<p>
|
||||
{{ "trialPaidInfoMessage" | i18n : orgLabel }}
|
||||
{{ "trialPaidInfoMessage" | i18n: orgLabel }}
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="tw-rounded tw-border tw-border-solid tw-border-secondary-300 tw-bg-background">
|
||||
<div class="tw-flex tw-h-auto tw-w-full tw-gap-5 tw-rounded-t tw-bg-secondary-100">
|
||||
<h2 class="tw-pb-4 tw-pl-4 tw-pt-5 tw-text-base tw-font-bold tw-uppercase">
|
||||
{{ "startYour7DayFreeTrialOfBitwardenFor" | i18n : orgDisplayName }}
|
||||
{{ "startYour7DayFreeTrialOfBitwardenFor" | i18n: orgDisplayName }}
|
||||
</h2>
|
||||
<environment-selector
|
||||
class="tw-mr-4 tw-mt-6 tw-flex-shrink-0 tw-text-end"
|
||||
|
||||
@@ -113,7 +113,7 @@ describe("TrialInitiationComponent", () => {
|
||||
token: "token",
|
||||
email: "testEmail",
|
||||
organizationUserId: "123",
|
||||
})
|
||||
}),
|
||||
);
|
||||
policyApiServiceMock.getPoliciesByToken.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
@@ -135,7 +135,7 @@ describe("TrialInitiationComponent", () => {
|
||||
enabled: true,
|
||||
},
|
||||
],
|
||||
} as ListResponse<PolicyResponse>)
|
||||
} as ListResponse<PolicyResponse>),
|
||||
);
|
||||
policyServiceMock.masterPasswordPolicyOptions$.mockReturnValue(
|
||||
of({
|
||||
@@ -145,7 +145,7 @@ describe("TrialInitiationComponent", () => {
|
||||
requireNumbers: null,
|
||||
requireSpecial: null,
|
||||
requireUpper: null,
|
||||
} as MasterPasswordPolicyOptions)
|
||||
} as MasterPasswordPolicyOptions),
|
||||
);
|
||||
|
||||
// Need to recreate component with new service mocks
|
||||
|
||||
@@ -119,7 +119,7 @@ export class TrialInitiationComponent implements OnInit, OnDestroy {
|
||||
private policyApiService: PolicyApiServiceAbstraction,
|
||||
private policyService: PolicyService,
|
||||
private i18nService: I18nService,
|
||||
private routerService: RouterService
|
||||
private routerService: RouterService,
|
||||
) {}
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
@@ -175,7 +175,7 @@ export class TrialInitiationComponent implements OnInit, OnDestroy {
|
||||
invite.organizationId,
|
||||
invite.token,
|
||||
invite.email,
|
||||
invite.organizationUserId
|
||||
invite.organizationUserId,
|
||||
);
|
||||
if (policies.data != null) {
|
||||
const policiesData = policies.data.map((p) => new PolicyData(p));
|
||||
|
||||
@@ -15,7 +15,7 @@ export class TwoFactorOptionsComponent extends BaseTwoFactorOptionsComponent {
|
||||
twoFactorService: TwoFactorService,
|
||||
router: Router,
|
||||
i18nService: I18nService,
|
||||
platformUtilsService: PlatformUtilsService
|
||||
platformUtilsService: PlatformUtilsService,
|
||||
) {
|
||||
super(twoFactorService, router, i18nService, platformUtilsService, window);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{{ "enterVerificationCodeApp" | i18n }}
|
||||
</p>
|
||||
<p *ngIf="selectedProviderType === providerType.Email">
|
||||
{{ "enterVerificationCodeEmail" | i18n : twoFactorEmail }}
|
||||
{{ "enterVerificationCodeEmail" | i18n: twoFactorEmail }}
|
||||
</p>
|
||||
<div class="form-group">
|
||||
<label for="code" class="sr-only">{{ "verificationCode" | i18n }}</label>
|
||||
|
||||
@@ -44,7 +44,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
appIdService: AppIdService,
|
||||
loginService: LoginService,
|
||||
configService: ConfigServiceAbstraction,
|
||||
@Inject(WINDOW) protected win: Window
|
||||
@Inject(WINDOW) protected win: Window,
|
||||
) {
|
||||
super(
|
||||
authService,
|
||||
@@ -60,7 +60,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
twoFactorService,
|
||||
appIdService,
|
||||
loginService,
|
||||
configService
|
||||
configService,
|
||||
);
|
||||
this.onSuccessfulLoginNavigate = this.goAfterLogIn;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ export class TwoFactorComponent extends BaseTwoFactorComponent {
|
||||
comp.onRecoverSelected.subscribe(() => {
|
||||
modal.close();
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export class UpdatePasswordComponent extends BaseUpdatePasswordComponent {
|
||||
logService: LogService,
|
||||
stateService: StateService,
|
||||
userVerificationService: UserVerificationService,
|
||||
dialogService: DialogService
|
||||
dialogService: DialogService,
|
||||
) {
|
||||
super(
|
||||
router,
|
||||
@@ -45,7 +45,7 @@ export class UpdatePasswordComponent extends BaseUpdatePasswordComponent {
|
||||
stateService,
|
||||
userVerificationService,
|
||||
logService,
|
||||
dialogService
|
||||
dialogService,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ export class VerifyEmailTokenComponent implements OnInit {
|
||||
private route: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
private logService: LogService,
|
||||
private stateService: StateService
|
||||
private stateService: StateService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -31,7 +31,7 @@ export class VerifyEmailTokenComponent implements OnInit {
|
||||
if (qParams.userId != null && qParams.token != null) {
|
||||
try {
|
||||
await this.apiService.postAccountVerifyEmailToken(
|
||||
new VerifyEmailRequest(qParams.userId, qParams.token)
|
||||
new VerifyEmailRequest(qParams.userId, qParams.token),
|
||||
);
|
||||
if (await this.stateService.getIsAuthenticated()) {
|
||||
await this.apiService.refreshIdentityToken();
|
||||
|
||||
@@ -26,7 +26,7 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
private i18nService: I18nService,
|
||||
private route: ActivatedRoute,
|
||||
private logService: LogService
|
||||
private logService: LogService,
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -50,7 +50,7 @@ export class VerifyRecoverDeleteComponent implements OnInit {
|
||||
this.platformUtilsService.showToast(
|
||||
"success",
|
||||
this.i18nService.t("accountDeleted"),
|
||||
this.i18nService.t("accountDeletedDesc")
|
||||
this.i18nService.t("accountDeletedDesc"),
|
||||
);
|
||||
this.router.navigate(["/"]);
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user