flows: add shortcut to redirect current flow (#3192)

This commit is contained in:
Jens L
2022-07-01 23:19:41 +02:00
committed by GitHub
parent 1c64616ebd
commit 5e3f44dd87
8 changed files with 61 additions and 8 deletions

View File

@ -0,0 +1,55 @@
---
title: Example Flows
---
:::info
You can apply these flows multiple times to stay updated, however this will discard all changes you've made.
:::
:::info
The example flows provided below will **override** the default flows, please review the contents of the example flow before importing and consider exporting the affected existing flows first.
:::
## Enrollment (2 Stage)
Flow: right-click [here](/flows/enrollment-2-stage.akflow) and save the file.
Sign-up flow for new users, which prompts them for their username, email, password and name. No verification is done. Users are also immediately logged on after this flow.
## Enrollment with email verification
Flow: right-click [here](/flows/enrollment-email-verification.akflow) and save the file.
Same flow as above, with an extra email verification stage.
You'll probably have to adjust the Email stage and set your connection details.
## Two-factor Login
Flow: right-click [here](/flows/login-2fa.akflow) and save the file.
Login flow which follows the default pattern (username/email, then password), but also checks for the user's OTP token, if they have one configured
## Login with conditional Captcha
Flow: right-click [here](/flows/login-conditional-captcha.akflow) and save the file.
Login flow which conditionally shows the users a captcha, based on the reputation of their IP and Username.
By default, the captcha test keys are used. You can get a proper key [here](https://www.google.com/recaptcha/intro/v3.html)
## Recovery with email verification
Flow: right-click [here](/flows/recovery-email-verification.akflow) and save the file.
Recovery flow, the user is sent an email after they've identified themselves. After they click on the link in the email, they are prompted for a new password and immediately logged on.
## User deletion
Flow: right-click [here](/flows/unenrollment.akflow) and save the file.
Flow for users to delete their account,
:::warning
This is done without any warning.
:::

View File

@ -0,0 +1,17 @@
---
title: Example policy snippets for flows
---
### Redirect current flow to another URL
:::info
Requires authentik 2022.7
:::
```python
plan = request.context["flow_plan"]
plan.redirect("https://foo.bar")
return False
```
This policy should be bound to the stage after your redirect should happen. For example, if you have an identification and a password stage, and you want to redirect after identification, bind the policy to the password stage. Make sure the policy binding is set to re-evaluate policies.