From 4f800c4758a5d6d92a9ece7a997db687a24e0994 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 1 Jan 2022 20:25:49 +0100 Subject: [PATCH] web/flows: include user in access denied stage closes #2039 Signed-off-by: Jens Langhammer --- web/src/flows/FlowExecutor.ts | 2 +- .../access_denied/AccessDeniedStage.ts} | 31 +++++++++++++++---- web/src/locales/en.po | 5 +-- web/src/locales/fr_FR.po | 5 +-- web/src/locales/pseudo-LOCALE.po | 5 +-- web/src/locales/tr.po | 5 +-- 6 files changed, 38 insertions(+), 15 deletions(-) rename web/src/flows/{access_denied/FlowAccessDenied.ts => stages/access_denied/AccessDeniedStage.ts} (64%) diff --git a/web/src/flows/FlowExecutor.ts b/web/src/flows/FlowExecutor.ts index 1687eb485..082f4a440 100644 --- a/web/src/flows/FlowExecutor.ts +++ b/web/src/flows/FlowExecutor.ts @@ -31,10 +31,10 @@ import { EVENT_FLOW_ADVANCE, TITLE_DEFAULT } from "../constants"; import "../elements/LoadingOverlay"; import { first } from "../utils"; import "./FlowInspector"; -import "./access_denied/FlowAccessDenied"; import "./sources/apple/AppleLoginInit"; import "./sources/plex/PlexLoginInit"; import "./stages/RedirectStage"; +import "./stages/access_denied/AccessDeniedStage"; import "./stages/authenticator_duo/AuthenticatorDuoStage"; import "./stages/authenticator_sms/AuthenticatorSMSStage"; import "./stages/authenticator_static/AuthenticatorStaticStage"; diff --git a/web/src/flows/access_denied/FlowAccessDenied.ts b/web/src/flows/stages/access_denied/AccessDeniedStage.ts similarity index 64% rename from web/src/flows/access_denied/FlowAccessDenied.ts rename to web/src/flows/stages/access_denied/AccessDeniedStage.ts index 5fe74bc36..3f236e469 100644 --- a/web/src/flows/access_denied/FlowAccessDenied.ts +++ b/web/src/flows/stages/access_denied/AccessDeniedStage.ts @@ -2,8 +2,9 @@ import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, html } from "lit"; import { customElement } from "lit/decorators.js"; +import { ifDefined } from "lit/directives/if-defined.js"; -import AKGlobal from "../../authentik.css"; +import AKGlobal from "../../../authentik.css"; import PFForm from "@patternfly/patternfly/components/Form/form.css"; import PFFormControl from "@patternfly/patternfly/components/FormControl/form-control.css"; import PFList from "@patternfly/patternfly/components/List/list.css"; @@ -13,11 +14,13 @@ import PFBase from "@patternfly/patternfly/patternfly-base.css"; import { AccessDeniedChallenge, FlowChallengeResponseRequest } from "@goauthentik/api"; -import "../../elements/EmptyState"; -import { BaseStage } from "../stages/base"; +import "../../../elements/EmptyState"; +import { PFSize } from "../../../elements/Spinner"; +import "../../FormStatic"; +import { BaseStage } from "../base"; @customElement("ak-stage-access-denied") -export class FlowAccessDenied extends BaseStage< +export class AccessDeniedStage extends BaseStage< AccessDeniedChallenge, FlowChallengeResponseRequest > { @@ -33,7 +36,23 @@ export class FlowAccessDenied extends BaseStage<

${this.challenge.flowInfo?.title}