Permalink
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...
1 parent a7e1b7f commit 6e5ee3538a10679257982f2e1226db7a8ef7c535 @nurpax nurpax committed Dec 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 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"

0 comments on commit 6e5ee35

Please sign in to comment.