Rough draft to combine user verification required and master password required prompts
This commit is contained in:
parent
ee7844d6b1
commit
f72d6f877f
|
@ -220,9 +220,10 @@ export class Fido2Component implements OnInit, OnDestroy {
|
||||||
async submit() {
|
async submit() {
|
||||||
const data = this.message$.value;
|
const data = this.message$.value;
|
||||||
if (data?.type === "PickCredentialRequest") {
|
if (data?.type === "PickCredentialRequest") {
|
||||||
let userVerified = false;
|
const userVerified = await this.handleUserVerification(data.userVerification);
|
||||||
if (data.userVerification) {
|
|
||||||
userVerified = await this.passwordRepromptService.showPasswordPrompt();
|
if (!userVerified) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.send({
|
this.send({
|
||||||
|
@ -232,8 +233,6 @@ export class Fido2Component implements OnInit, OnDestroy {
|
||||||
userVerified,
|
userVerified,
|
||||||
});
|
});
|
||||||
} else if (data?.type === "ConfirmNewCredentialRequest") {
|
} else if (data?.type === "ConfirmNewCredentialRequest") {
|
||||||
let userVerified = false;
|
|
||||||
|
|
||||||
if (this.cipher.login.fido2Credentials.length > 0) {
|
if (this.cipher.login.fido2Credentials.length > 0) {
|
||||||
const confirmed = await this.dialogService.openSimpleDialog({
|
const confirmed = await this.dialogService.openSimpleDialog({
|
||||||
title: { key: "overwritePasskey" },
|
title: { key: "overwritePasskey" },
|
||||||
|
@ -246,8 +245,10 @@ export class Fido2Component implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.userVerification) {
|
const userVerified = await this.handleUserVerification(data.userVerification);
|
||||||
userVerified = await this.passwordRepromptService.showPasswordPrompt();
|
|
||||||
|
if (!userVerified) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.send({
|
this.send({
|
||||||
|
@ -404,6 +405,16 @@ export class Fido2Component implements OnInit, OnDestroy {
|
||||||
this.destroy$.complete();
|
this.destroy$.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async handleUserVerification(userVerification: boolean): Promise<boolean> {
|
||||||
|
const masterPasswordRempromptRequired = this.cipher && this.cipher.reprompt !== 0;
|
||||||
|
|
||||||
|
if (!masterPasswordRempromptRequired && !userVerification) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return await this.passwordRepromptService.showPasswordPrompt();
|
||||||
|
}
|
||||||
|
|
||||||
private send(msg: BrowserFido2Message) {
|
private send(msg: BrowserFido2Message) {
|
||||||
BrowserFido2UserInterfaceSession.sendMessage({
|
BrowserFido2UserInterfaceSession.sendMessage({
|
||||||
sessionId: this.sessionId,
|
sessionId: this.sessionId,
|
||||||
|
|
Loading…
Reference in New Issue