website/docs: Update flow to run only during Github logins (#2959)

This commit is contained in:
TheMythologist 2022-05-27 22:07:33 +08:00 committed by Jens Langhammer
parent 1b3aacfa1d
commit 987f03c4be
1 changed files with 4 additions and 0 deletions

View File

@ -57,6 +57,10 @@ Requires authentik 2021.12.5.
To check if the user is member of an organisation, you can use the following policy on your flows:
```python
# Ensure flow is only run during oauth logins via Github
if context['source'].provider_type != "github":
return True
accepted_org = "foo"
# Get the user-source connection object from the context, and get the access token