flows: fix OOB flow incorrectly setting pending user
closes #3224 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -13,11 +13,11 @@ By default, the email is sent to the currently pending user. To override this, y
|
||||
For example, create this expression policy and bind it to the email stage:
|
||||
|
||||
```python
|
||||
request.context["email"] = "foo@bar.baz"
|
||||
request.context["flow_plan"].context["email"] = "foo@bar.baz"
|
||||
# Or get it from a prompt
|
||||
# request.context["email"] = request.context["prompt_data"]["email"]
|
||||
# request.context["flow_plan"].context["email"] = request.context["prompt_data"]["email"]
|
||||
# Or another user attribute
|
||||
# request.context["email"] = request.context["pending_user"].attributes.get("otherEmail")
|
||||
# request.context["flow_plan"].context["email"] = request.context["pending_user"].attributes.get("otherEmail")
|
||||
return True
|
||||
```
|
||||
|
||||
|
||||
@ -14,6 +14,6 @@ Starting with authentik 2022.5, users can be added to dynamic groups. To do so,
|
||||
from authentik.core.models import Group
|
||||
group, _ = Group.objects.get_or_create(name="some-group")
|
||||
# ["groups"] *must* be set to an array of Group objects, names alone are not enough.
|
||||
request.context["groups"] = [group]
|
||||
request.context["flow_plan"].context["groups"] = [group]
|
||||
return True
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user