yesod-auth 1.4.20 → 1.4.21
raw patch · 3 files changed
+15/−5 lines, 3 files
Files
- ChangeLog.md +4/−0
- Yesod/Auth.hs +10/−4
- yesod-auth.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.4.21++* Add redirectToCurrent to Yesod.Auth module for controlling setUltDestCurrent in redirectLogin [#1461](https://github.com/yesodweb/yesod/pull/1461)+ ## 1.4.20 * Extend `YesodAuthEmail` to support extensible password hashing via
Yesod/Auth.hs view
@@ -166,7 +166,7 @@ -- > when (isJust ma) $ -- > lift $ redirect HomeR -- or any other Handler code you want -- > defaultLoginHandler- -- + -- loginHandler :: HandlerT Auth (HandlerT master IO) Html loginHandler = defaultLoginHandler @@ -182,6 +182,12 @@ redirectToReferer :: master -> Bool redirectToReferer _ = False + -- | When being redirected to the login page should the current page+ -- be set to redirect back to. Default is 'True'.+ -- @since 1.4.18+ redirectToCurrent :: master -> Bool+ redirectToCurrent _ = True+ -- | Return an HTTP connection manager that is stored in the foundation -- type. This allows backends to reuse persistent connections. If none of -- the backends you're using use HTTP connections, you can safely return@@ -551,15 +557,15 @@ => HandlerT master IO (AuthId master, AuthEntity master) requireAuthPair = maybeAuthPair >>= maybe handleAuthLack return -handleAuthLack :: Yesod master => HandlerT master IO a+handleAuthLack :: YesodAuth master => HandlerT master IO a handleAuthLack = do aj <- acceptsJson if aj then notAuthenticated else redirectLogin -redirectLogin :: Yesod master => HandlerT master IO a+redirectLogin :: YesodAuth master => HandlerT master IO a redirectLogin = do y <- getYesod- setUltDestCurrent+ when (redirectToCurrent y) setUltDestCurrent case authRoute y of Just z -> redirect z Nothing -> permissionDenied "Please configure authRoute"
yesod-auth.cabal view
@@ -1,5 +1,5 @@ name: yesod-auth-version: 1.4.20+version: 1.4.21 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin