Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing flow creates new prompts instead of reusing existing ones #2941

Closed
BobSilent opened this issue May 24, 2022 · 2 comments
Closed

Importing flow creates new prompts instead of reusing existing ones #2941

BobSilent opened this issue May 24, 2022 · 2 comments
Labels
bug/confirmed Confirmed bugs bug Something isn't working

Comments

@BobSilent
Copy link
Contributor

Description

After initial setup the list of prompts has 9 elements
image

after importing the Example flow: Enrollment with email verification, the list has 5 new elements. But these "new element" have already been there before import (from Field, Label and Type perspective).
image

Importing the sample flow again, will create again additional new prompts, and especially as the documentation suggested to update the flow like that:
image

In stages configuration I cannot really distinguish between all the same named prompts:
image

Expected behavior/questions:

  • should the prompt list be extended, if the prompts are already available (username, name, email, password, password_repeat) ?
  • is the ordering correct (username and password have both 0..)?
  • are the so called "prompts", not more "fields" or "field definitions"? and should the ordering better be done in the stages setup where the "fields" get used - so that a stage decides about the ordering of a field?

Reproduce

Steps to reproduce the behavior:

  1. Clean initial Setup
  2. Download Example flow: Enrollment with email verification
  3. Navigate in admin interface to "Flow & Stages"
  4. check "Prompts" list
  5. Navigate to Flow and import downloaded flow (2.)
  6. check "Prompts" list

Version and Deployment (please complete the following information):

  • authentik version: 2022.5.2
  • Deployment: docker-compose
@BobSilent BobSilent added the bug Something isn't working label May 24, 2022
@BeryJu
Copy link
Member

BeryJu commented May 24, 2022

Interesting, for the first import that is (sadly) to be expected, since the existence check is done based on primary key, so that will (for the foreseeable future or until #1573 happens) be the case.

However, after the first import, that should not be the case, as the primary key of the akflow is used 1:1 in the database so it should update the existing prompts

@BobSilent
Copy link
Contributor Author

BobSilent commented May 24, 2022

I just retested it on my test instance, as unfortunately I recognized this on my productive instance... where i already imported different example flows.

But: i used multiple times the enrollment-email-verification.akflow which i downloaded on 2022-03-18 (i think there was no update on the flow since then) but i happend again.

Flows and Stages get overwritten, Prompts get added...
image

When i look at the Ids, eg. for the email prompt, i see in the akflow file:

        {
            "identifiers": {
                "pk": "1ff91927-e33d-4615-95b0-c258e5f0df62"
            },
            "model": "authentik_stages_prompt.prompt",
            "attrs": {
                "field_key": "email",
                "label": "Email",
                "type": "email",
                "required": true,
                "placeholder": "Email",
                "order": 1
            }
        },

but none of the (imported) prompts has this pk:
image

@BeryJu BeryJu added the bug/confirmed Confirmed bugs label May 24, 2022
@BeryJu BeryJu closed this as completed in 56babb2 May 24, 2022
BeryJu added a commit that referenced this issue May 24, 2022
closes #2941

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed Confirmed bugs bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants