stages/authentiactor_validate: improve error handling for duo
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -55,6 +55,7 @@ export class AuthenticatorValidateStage
|
||||
set selectedDeviceChallenge(value: DeviceChallenge | undefined) {
|
||||
this._selectedDeviceChallenge = value;
|
||||
if (!value) return;
|
||||
if (value === this._selectedDeviceChallenge) return;
|
||||
// We don't use this.submit here, as we don't want to advance the flow.
|
||||
// We just want to notify the backend which challenge has been selected.
|
||||
new FlowsApi(DEFAULT_CONFIG).flowsExecutorSolve({
|
||||
|
||||
@ -50,6 +50,7 @@ export class AuthenticatorValidateStageWebDuo extends BaseStage<
|
||||
if (!this.challenge) {
|
||||
return html`<ak-empty-state ?loading="${true}" header=${t`Loading`}> </ak-empty-state>`;
|
||||
}
|
||||
const errors = this.challenge.responseErrors?.duo || [];
|
||||
return html`<div class="pf-c-login__main-body">
|
||||
<form
|
||||
class="pf-c-form"
|
||||
@ -69,6 +70,10 @@ export class AuthenticatorValidateStageWebDuo extends BaseStage<
|
||||
</div>
|
||||
</ak-form-static>
|
||||
|
||||
${errors.map((err) => {
|
||||
return html`<p>${err.string}</p>`;
|
||||
})}
|
||||
|
||||
<div class="pf-c-form__group pf-m-action">
|
||||
<button type="submit" class="pf-c-button pf-m-primary pf-m-block">
|
||||
${t`Continue`}
|
||||
|
||||
Reference in New Issue
Block a user