From 021b0f48f9bd53786ba4c20a35e2ab0abebae4ac Mon Sep 17 00:00:00 2001 From: Tero Laitinen Date: Tue, 7 May 2013 21:31:51 +0300 Subject: [PATCH] 401 Unauthorized HTTP status code for JSON-reply login fails --- yesod-auth/Yesod/Auth/HashDB.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yesod-auth/Yesod/Auth/HashDB.hs b/yesod-auth/Yesod/Auth/HashDB.hs index d441475c..80990a8d 100644 --- a/yesod-auth/Yesod/Auth/HashDB.hs +++ b/yesod-auth/Yesod/Auth/HashDB.hs @@ -89,7 +89,7 @@ import Data.Digest.Pure.SHA (sha1, showDigest) import Data.Text (Text, pack, unpack, append) import Data.Maybe (fromMaybe) import System.Random (randomRIO) - +import Network.HTTP.Types (unauthorized401) -- | Interface for data type which holds user info. It's just a -- collection of getters and setters class HashDBUser user where @@ -189,7 +189,7 @@ loginMsg dest msg = selectRep (do fmap asHtml $ redirect dest provideRep $ return $ object [ "message" .= msg - ]) >>= sendResponse + ]) >>= sendResponseStatus unauthorized401 where asHtml :: Html -> Html asHtml = id