1
0
mirror of https://github.com/bitwarden/web synced 2026-01-08 03:23:29 +00:00

Update jslib and use new UserVerificationService pattern (#1302)

* Use try/catch pattern for userVerification

* Update deps
This commit is contained in:
Thomas Rittson
2021-11-17 09:37:36 +10:00
committed by GitHub
parent 8889722388
commit f740d8b057
8 changed files with 58 additions and 48 deletions

View File

@@ -32,10 +32,9 @@ export class ApiKeyComponent {
constructor(private userVerificationService: UserVerificationService, private logService: LogService) { }
async submit() {
const request = await this.userVerificationService.buildRequest(this.masterPassword);
try {
this.formPromise = this.postKey(this.entityId, request);
this.formPromise = this.userVerificationService.buildRequest(this.masterPassword)
.then(request => this.postKey(this.entityId, request));
const response = await this.formPromise;
this.clientSecret = response.apiKey;
this.clientId = `${this.keyType}.${this.entityId}`;