Skip to content

Commit 424d044

Browse files
committed
logoutHandler now reloads the page after the logout since not everything on the page dynamically responds to the login status
1 parent 355f82f commit 424d044

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Happstack/Authenticate/Client.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ import GHCJS.DOM.Document (setCookie)
6161
import GHCJS.DOM.EventM (EventName, EventM)
6262
import qualified GHCJS.DOM.EventM as EventM
6363
import qualified GHCJS.DOM.GlobalEventHandlers as DOM (load)
64-
import GHCJS.DOM.Location (Location, getSearch, setHref)
64+
import GHCJS.DOM.Location (Location, getSearch, reload, setHref)
6565
import qualified GHCJS.DOM.URLSearchParams as Search
6666
import GHCJS.DOM.Window (getLocalStorage, getLocation)
6767
import GHCJS.DOM.Storage (Storage, getItem, removeItem, setItem)
@@ -533,6 +533,9 @@ logoutHandler routeFn update modelTV e =
533533
do debugStrLn $ "logoutHandler - logout"
534534
(Just d) <- GHCJS.currentDocument
535535
clearUser routeFn modelTV
536+
(Just w) <- GHCJS.currentWindow
537+
location <- getLocation w
538+
reload location
536539
_ ->
537540
do debugStrLn $ "unknown action - " ++ show action
538541
Nothing -> do debugStrLn "target is not an element"

0 commit comments

Comments
 (0)