From 8ecac59ecaa6b7e26a936e06fc119cfc446f9a88 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 24 May 2021 22:52:06 +0200 Subject: [PATCH] stages/prompt: annotate PromptChallengeResponse's additionalProperties Signed-off-by: Jens Langhammer --- authentik/api/schema.py | 7 +++++++ schema.yml | 1 + .../identification/IdentificationStage.ts | 2 +- web/src/flows/stages/prompt/PromptStage.ts | 20 +++++++++---------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/authentik/api/schema.py b/authentik/api/schema.py index 4548a80f0..994ed5af7 100644 --- a/authentik/api/schema.py +++ b/authentik/api/schema.py @@ -67,4 +67,11 @@ def postprocess_schema_responses(result, generator, **kwargs): # noqa: W0613 spectacular_settings.APPEND_COMPONENTS ) + # This is a workaround for authentik/stages/prompt/stage.py + # since the serializer PromptChallengeResponse + # accepts dynamic keys + for component in result["components"]["schemas"]: + if component == "PromptChallengeResponseRequest": + comp = result["components"]["schemas"][component] + comp["additionalProperties"] = {} return result diff --git a/schema.yml b/schema.yml index a3ba86cb1..f3fc073d5 100644 --- a/schema.yml +++ b/schema.yml @@ -23321,6 +23321,7 @@ components: component: type: string default: ak-stage-prompt + additionalProperties: {} PromptRequest: type: object description: Prompt Serializer diff --git a/web/src/flows/stages/identification/IdentificationStage.ts b/web/src/flows/stages/identification/IdentificationStage.ts index c14d61630..78d23b30f 100644 --- a/web/src/flows/stages/identification/IdentificationStage.ts +++ b/web/src/flows/stages/identification/IdentificationStage.ts @@ -160,7 +160,7 @@ export class IdentificationStage extends BaseStage + .errors=${(this.challenge?.responseErrors || {})["uid_field"]}> - ${errors.map(err => { - return html`
-
- -
-

- ${err.string} -

-
`; - })} + ${errors.map(err => { + return html`
+
+ +
+

+ ${err.string} +

+
`; + })} `; }