tanguilp / plugoid

OpenID Connect Plug for Elixir's Phoenix web framework
https://hexdocs.pm/plugoid/
Apache License 2.0
16 stars 1 forks source link

Try to get authentication but continue as unauthenticated #9

Closed brianmay closed 2 years ago

brianmay commented 2 years ago

I commonly have a / page that shows a brief introduction to the website, and then allows the user to login if they aren't already logged. To do this, I generally use two pipelines:

Would be good if there was some way of doing this with plugoid.

tanguilp commented 2 years ago

You want to use the on_unauthenticated option (https://hexdocs.pm/plugoid/Plugoid.html#module-additional-plug-options).

Example in plugoid_demo: https://github.com/tanguilp/plugoid_demo/blob/master/lib/plugoid_demo_web/router.ex#L34

brianmay commented 2 years ago

Yes, looks like that does it. Thanks