Skip to content

Commit 6216118

Browse files
committed
do not attempt to redirect after login if the login failed
1 parent 6d51082 commit 6216118

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/Happstack/Authenticate/Client.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,13 @@ urlBase64Decode bs = Base64.decode (addPadding (BS.map urlDecode bs))
403403
postLoginRedirect :: TVar AuthenticateModel -> IO ()
404404
postLoginRedirect modelTV =
405405
do m <- atomically $ readTVar modelTV
406-
case _postLoginRedirectURL m of
407-
Nothing -> pure ()
408-
(Just url) -> do
406+
case (_postLoginRedirectURL m, _muser m) of
407+
(Just url, Just _) -> do
409408
(Just w) <- GHCJS.currentWindow
410409
location <- getLocation w
411410
setHref location url
412411
pure ()
412+
_ -> pure ()
413413

414414
postSignupRedirect :: TVar AuthenticateModel -> IO ()
415415
postSignupRedirect modelTV =

0 commit comments

Comments
 (0)