From ca35204e0cf6ba1136ea9fef63dfd5c5d53db477 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Thu, 8 Apr 2021 22:50:21 +0200 Subject: [PATCH] flows: ask for email address in oob flow Signed-off-by: Jens Langhammer --- authentik/flows/migrations/0018_oob_flows.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/authentik/flows/migrations/0018_oob_flows.py b/authentik/flows/migrations/0018_oob_flows.py index e39872f10..e89f3083b 100644 --- a/authentik/flows/migrations/0018_oob_flows.py +++ b/authentik/flows/migrations/0018_oob_flows.py @@ -71,13 +71,24 @@ def create_default_oob_flow(apps: Apps, schema_editor: BaseDatabaseSchemaEditor) "order": 100, }, ) + prompt_email, _ = Prompt.objects.using(db_alias).update_or_create( + field_key="email", + defaults={ + "label": "Email", + "type": FieldTypes.EMAIL, + "placeholder": "Admin email", + "order": 101, + }, + ) password_first = Prompt.objects.using(db_alias).get(field_key="password") password_second = Prompt.objects.using(db_alias).get(field_key="password_repeat") prompt_stage, _ = PromptStage.objects.using(db_alias).update_or_create( name="default-oob-password", ) - prompt_stage.fields.set([prompt_header, password_first, password_second]) + prompt_stage.fields.set( + [prompt_header, prompt_email, password_first, password_second] + ) prompt_stage.save() user_write, _ = UserWriteStage.objects.using(db_alias).update_or_create(