website/docs: Update flow to run only during Github logins (#2959)
This commit is contained in:
		 TheMythologist
					TheMythologist
				
			
				
					committed by
					
						 Jens Langhammer
						Jens Langhammer
					
				
			
			
				
	
			
			
			 Jens Langhammer
						Jens Langhammer
					
				
			
						parent
						
							1b3aacfa1d
						
					
				
				
					commit
					987f03c4be
				
			| @ -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 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user