diff --git a/web/src/flows/stages/password/PasswordStage.ts b/web/src/flows/stages/password/PasswordStage.ts index e57dd6ecf..2eec3c27b 100644 --- a/web/src/flows/stages/password/PasswordStage.ts +++ b/web/src/flows/stages/password/PasswordStage.ts @@ -26,6 +26,42 @@ export class PasswordStage extends BaseStage { + if (!this.input) { + return; + } + if (document.activeElement === this.input) { + this.cleanup(); + } + this.input.focus(); + }, 10); + console.debug("authentik/stages/password: started focus timer"); + return this.input; + } + + cleanup(): void { + if (this.timer) { + console.debug("authentik/stages/password: cleared focus timer"); + window.clearInterval(this.timer); + } + } + render(): TemplateResult { if (!this.challenge) { return html` `; @@ -63,16 +99,7 @@ export class PasswordStage extends BaseStage - + ${this.renderInput()} ${this.challenge.recoveryUrl