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,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.