web/stages/authenticator_validate: only show back button when multiple challenges
This commit is contained in:
parent
a0753bfc88
commit
b2449757f9
|
@ -119,13 +119,15 @@ export class AuthenticatorValidateStage extends BaseStage implements StageHost {
|
||||||
return html`<ak-stage-authenticator-validate-code
|
return html`<ak-stage-authenticator-validate-code
|
||||||
.host=${this}
|
.host=${this}
|
||||||
.challenge=${this.challenge}
|
.challenge=${this.challenge}
|
||||||
.deviceChallenge=${this.selectedDeviceChallenge}>
|
.deviceChallenge=${this.selectedDeviceChallenge}
|
||||||
|
.showBackButton=${(this.challenge?.device_challenges.length || []) > 1}>
|
||||||
</ak-stage-authenticator-validate-code>`;
|
</ak-stage-authenticator-validate-code>`;
|
||||||
case DeviceClasses.WEBAUTHN:
|
case DeviceClasses.WEBAUTHN:
|
||||||
return html`<ak-stage-authenticator-validate-webauthn
|
return html`<ak-stage-authenticator-validate-webauthn
|
||||||
.host=${this}
|
.host=${this}
|
||||||
.challenge=${this.challenge}
|
.challenge=${this.challenge}
|
||||||
.deviceChallenge=${this.selectedDeviceChallenge}>
|
.deviceChallenge=${this.selectedDeviceChallenge}
|
||||||
|
.showBackButton=${(this.challenge?.device_challenges.length || []) > 1}>
|
||||||
</ak-stage-authenticator-validate-webauthn>`;
|
</ak-stage-authenticator-validate-webauthn>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,9 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
deviceChallenge?: DeviceChallenge;
|
deviceChallenge?: DeviceChallenge;
|
||||||
|
|
||||||
|
@@property({ type: Boolean })
|
||||||
|
showBackButton = false;
|
||||||
|
|
||||||
static get styles(): CSSResult[] {
|
static get styles(): CSSResult[] {
|
||||||
return COMMON_STYLES;
|
return COMMON_STYLES;
|
||||||
}
|
}
|
||||||
|
@ -61,14 +64,16 @@ export class AuthenticatorValidateStageWebCode extends BaseStage {
|
||||||
</div>
|
</div>
|
||||||
<footer class="pf-c-login__main-footer">
|
<footer class="pf-c-login__main-footer">
|
||||||
<ul class="pf-c-login__main-footer-links">
|
<ul class="pf-c-login__main-footer-links">
|
||||||
<li class="pf-c-login__main-footer-links-item">
|
${this.showBackButton ?
|
||||||
|
html`<li class="pf-c-login__main-footer-links-item">
|
||||||
<button class="pf-c-button pf-m-secondary pf-m-block" @click=${() => {
|
<button class="pf-c-button pf-m-secondary pf-m-block" @click=${() => {
|
||||||
if (!this.host) return;
|
if (!this.host) return;
|
||||||
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
|
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
|
||||||
}}>
|
}}>
|
||||||
${gettext("Return to device picker")}
|
${gettext("Return to device picker")}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>`:
|
||||||
|
html``}
|
||||||
</ul>
|
</ul>
|
||||||
</footer>`;
|
</footer>`;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,9 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
|
||||||
@property()
|
@property()
|
||||||
authenticateMessage = "";
|
authenticateMessage = "";
|
||||||
|
|
||||||
|
@property({type: Boolean})
|
||||||
|
showBackButton = false;
|
||||||
|
|
||||||
static get styles(): CSSResult[] {
|
static get styles(): CSSResult[] {
|
||||||
return COMMON_STYLES;
|
return COMMON_STYLES;
|
||||||
}
|
}
|
||||||
|
@ -98,14 +101,16 @@ export class AuthenticatorValidateStageWebAuthn extends BaseStage {
|
||||||
</div>
|
</div>
|
||||||
<footer class="pf-c-login__main-footer">
|
<footer class="pf-c-login__main-footer">
|
||||||
<ul class="pf-c-login__main-footer-links">
|
<ul class="pf-c-login__main-footer-links">
|
||||||
<li class="pf-c-login__main-footer-links-item">
|
${this.showBackButton ?
|
||||||
|
html`<li class="pf-c-login__main-footer-links-item">
|
||||||
<button class="pf-c-button pf-m-secondary pf-m-block" @click=${() => {
|
<button class="pf-c-button pf-m-secondary pf-m-block" @click=${() => {
|
||||||
if (!this.host) return;
|
if (!this.host) return;
|
||||||
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
|
(this.host as AuthenticatorValidateStage).selectedDeviceChallenge = undefined;
|
||||||
}}>
|
}}>
|
||||||
${gettext("Return to device picker")}
|
${gettext("Return to device picker")}
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>`:
|
||||||
|
html``}
|
||||||
</ul>
|
</ul>
|
||||||
</footer>`;
|
</footer>`;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue