goauthentik / authentik

The authentication glue you need.
https://goauthentik.io
Other
12.88k stars 858 forks source link

Discord docs expression policy doubt #10555

Open bot37 opened 2 months ago

bot37 commented 2 months ago

goauthentik/authentik/blob/main/website/docs/sources/discord/index.md

Hello! This line in the documentation seems counter-intuitive. Why does it return True instead of False? Thanks!

if context['source'].provider_type != "discord": return True

Keyinator commented 1 month ago

The stages these policies are applied to are usually used for multiple sources.

Returning false would result in other sources not working for any stage having this expression policy bound. Returning true will "skip" this policy for non-discord related sources.