From 395dc08f05ea49448ba49af504fcec4cb4e72e49 Mon Sep 17 00:00:00 2001 From: Jens L Date: Sun, 7 May 2023 12:58:14 +0200 Subject: [PATCH] web/flows: don't autoclose in redirect stage if redirecting to non-http protocol (#5506) Signed-off-by: Jens Langhammer --- .../flow/providers/oauth2/DeviceCodeFinish.ts | 32 ++++++------------- web/src/flow/stages/RedirectStage.ts | 3 -- 2 files changed, 10 insertions(+), 25 deletions(-) diff --git a/web/src/flow/providers/oauth2/DeviceCodeFinish.ts b/web/src/flow/providers/oauth2/DeviceCodeFinish.ts index 199b8aaaf..1813426eb 100644 --- a/web/src/flow/providers/oauth2/DeviceCodeFinish.ts +++ b/web/src/flow/providers/oauth2/DeviceCodeFinish.ts @@ -1,37 +1,25 @@ import "@goauthentik/elements/EmptyState"; import "@goauthentik/flow/FormStatic"; -import { AccessDeniedStage } from "@goauthentik/flow/stages/access_denied/AccessDeniedStage"; +import { BaseStage } from "@goauthentik/flow/stages/base"; import { t } from "@lingui/macro"; import { TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; +import { OAuthDeviceCodeFinishChallenge } from "@goauthentik/api"; + @customElement("ak-flow-provider-oauth2-code-finish") -export class DeviceCodeFinish extends AccessDeniedStage { +export class DeviceCodeFinish extends BaseStage< + OAuthDeviceCodeFinishChallenge, + OAuthDeviceCodeFinishChallenge +> { render(): TemplateResult { if (!this.challenge) { return html` `; } - return html` - -
- -
`; + return html` + ${t`You've successfully authenticated your device.`} + `; } } diff --git a/web/src/flow/stages/RedirectStage.ts b/web/src/flow/stages/RedirectStage.ts index 2181fefcd..591dc66fe 100644 --- a/web/src/flow/stages/RedirectStage.ts +++ b/web/src/flow/stages/RedirectStage.ts @@ -64,9 +64,6 @@ export class RedirectStage extends BaseStage { - window.close(); - }, 500); return html`