@@ -44,7 +44,7 @@ import qualified GHC.Generics as GHC
4444import Data.Aeson
4545import Data.Binary.Builder (toLazyByteString)
4646
47−type AuthenticationHandler = ReqBody '[JSON] AuthenticationCredits :> Post '[JSON] (Headers '[Header "Set-Cookie" String] Int)
47+type AuthenticationHandler = ReqBody '[JSON] AuthenticationCredits :> PostNoContent '[JSON, PlainText, FormUrlEncoded] (Headers '[Header "Set-Cookie" String] NoContent)
4848
4949data AuthenticationCredits = AuthenticationCredits {authenticationId :: UserId}
5050 deriving GHC.Generic
@@ -64,7 +64,7 @@ authenticate (AuthenticationCredits uId) = do
6464 -- setCookieDomain = Just "127.0.0.1",
6565 setCookiePath = Just "/" }
6666 -- let token = cookieTokenKeyString <> "=" <> show tId <> "; Expires=" <> show expire <> "; Domain=127.0.0.1:2000; Path=/" -- ; Secure" --; HttpOnly"
67− return $ addHeader (L.unpack . toLazyByteString . renderSetCookie $ cookie) 0
67+ return $ addHeader (L.unpack . toLazyByteString . renderSetCookie $ cookie) NoContent
6868
6969
7070checkToken :: DBConnection -> ByteString -> Handler UserId