Repository navigation
stages/prompt: add ability to set separate labels and values for choices - #16693
Merged
BeryJu merged 19 commits intoOct 15, 2025
Merged
Conversation
Value and label are set turned to a string.
This will make choices into a Array<{ [key: string]: any; }> | null which at some point it should be a defined interface.
Label and Value are used for Dropdown and RadioButtonGroup. Strings are still accepted.
Also fixed wrong choice example in previous docs changes
Choice can of course be anything, we shouldn't assume it's string or dict
Same as before, choice can be anything. We check if it's explicitely a dict
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-storybook canceled.
|
macmoritz
reviewed
Sep 16, 2025
macmoritz
reviewed
Sep 16, 2025
Co-authored-by: macmoritz <[email protected]> Signed-off-by: Erik Ahlund <[email protected]>
choices are now a list of PromptChoiceSerializer instead of a generic DictField. The PromptChallenge also forces the use of value/label object.
The front end can now safely use choices as an array of PromptChoice instead of it being either a string or an object.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16693 +/- ##
==========================================
- Coverage 92.98% 92.87% -0.11%
==========================================
Files 868 868
Lines 47833 47863 +30
==========================================
- Hits 44476 44455 -21
- Misses 3357 3408 +51
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Contributor
Author
Signed-off-by: Jens Langhammer <[email protected]>
Signed-off-by: Jens Langhammer <[email protected]>
GirlBossRush
approved these changes
Oct 15, 2025
BeryJu
approved these changes
Oct 15, 2025
dominic-r
reviewed
Oct 15, 2025
dominic-r
reviewed
Oct 15, 2025
dominic-r
reviewed
Oct 15, 2025
Signed-off-by: Dominic R <[email protected]>
Signed-off-by: Dominic R <[email protected]>
Signed-off-by: Dominic R <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Fixes #5197
This PR adds support for custom label and values in the select and radio components of the PromptStage by modifying the select object to accept an array of objects with value and label properties, while maintaining backward compatibility with string arrays. Key changes include:
Updated PromptStage.ts to handle both array of strings and array of { value: string, label: string } for select and radio inputs.
Added unit tests in authentik/stages/prompt/tests.py to verify new functionality and edge cases. (Further tests might be needed)
Updated relevant documentation to reflect the new option format in website/docs/add-secure-apps/flows-stages/stages/prompt/index.md
Please let me know if additional changes or tests are needed!
Checklist
ak test authentik/)make lint-fix)If an API change has been made
make gen-build)If changes to the frontend have been made
make web)If applicable
make docs)