Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Return () instead of AuthUser from forceLogin

forceLogin was returning an AuthUser for no apparent reason.  It
wasn't clear what the callee of this function would do with the
returned (unchanged) AuthUser, so use ().
  • Loading branch information...
commit 6e5ee3538a10679257982f2e1226db7a8ef7c535 1 parent a7e1b7f
@nurpax nurpax authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Snap/Snaplet/Auth/Handlers.hs
View
4 src/Snap/Snaplet/Auth/Handlers.hs
@@ -288,14 +288,14 @@ checkPasswordAndLogin u pw =
-- who she says she is.
--
forceLogin :: AuthUser -- ^ An existing user, somehow looked up from db
- -> Handler b (AuthManager b) (Either AuthFailure AuthUser)
+ -> Handler b (AuthManager b) (Either AuthFailure ())
forceLogin u = do
s <- gets session
withSession s $
case userId u of
Just x -> do
withTop s (setSessionUserId x)
- return $ Right u
+ return $ Right ()
Nothing -> return . Left $
AuthError $ "forceLogin: Can't force the login of a user "
++ "without userId"
Please sign in to comment.
Something went wrong with that request. Please try again.