Skip to content

Commit

Permalink
Make 'logout' forget remember token
Browse files Browse the repository at this point in the history
  • Loading branch information
ozataman committed Sep 29, 2011
1 parent 8766570 commit bbcb9f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Snap/Snaplet/Auth.hs
Expand Up @@ -135,6 +135,8 @@ logout :: Handler b (AuthManager b) ()
logout = do
s <- getsSnapletState session
withTop s $ withSession s removeSessionUserId
AuthManager _ _ _ _ rc _ _ _ <- getSnapletState
forgetRememberToken rc
modifySnapletState (\mgr -> mgr { activeUser = Nothing } )


Expand Down Expand Up @@ -297,9 +299,13 @@ forceLogin u = do

getRememberToken sk rc rp = getSecureCookie rc sk rp


setRememberToken sk rc rp token = setSecureCookie rc sk rp token


forgetRememberToken rc = expireCookie rc (Just "/")


------------------------------------------------------------------------------
-- | Set the current user's 'UserId' in the active session
setSessionUserId :: UserId -> Handler b SessionManager ()
Expand Down

0 comments on commit bbcb9f9

Please sign in to comment.