-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic redirect to logout on login #1788
Comments
You could do something like this: instance YesodAuth App where
onLogin = do
lookupSession "_ULT" >>= \case
Just url -> case parseRoute (toSegmentsAndQuery (encodeUtf8 url)) of
Just LogoutR -> clearUltDest
_ -> pure ()
Nothing -> pure () |
I'm looking at the yesod-scaffold repo (branch postgres). Wouldn't that patch be a nice one for |
@jezen, it doesn't look like a systematic solution. Yesod already knows what LogoutR is https://github.com/yesodweb/yesod/blob/master/yesod-auth/Yesod/Auth/Routes.hs and defines its behaviour. |
I haven't figured out yet how exactly this happens, but sometimes my website remembers I am on the
LogoutR
page, and after successful login redirects me to theLogoutR
, so I see messageYou successfully logged in
but I'm logged out.I think, it may be useful to skip LogoutR when trying to save ultimate destination, or when it is read. I can write a pull request, just give me a hint what is the proper solution.
The text was updated successfully, but these errors were encountered: