Login redirect depending on the route

Skip to first unread message

Dario Oddenino

May 10, 2022, 4:08:24 AM5/10/22
to Yesod Web Framework
Hi everyone,
is there a way to have more control on when yesod redirects to the default destination on login/signup?

I have some specific routes where I don't want the users to be redirected to, but it looks like there's no direct way to handle this right now (just a global Bool).

Any ideas?


May 26, 2022, 9:09:34 AM5/26/22
to Yesod Web Framework
You could use manual authentication instead of the isAuthorized function in Foundation.hs.

For pages where I have user-defined behavior if no user is logged in, I use maybeAuth together with redirect at the beginning of every handler.
Reply all
Reply to author
0 new messages