User_id support (via user_vars)

This commit is contained in:
Federico Rampazzo
2015-05-24 03:26:42 +01:00
parent 1cc53245c5
commit 83f48dcd15
6 changed files with 63 additions and 14 deletions
+2 -2
View File
@@ -120,9 +120,9 @@ app conf reqBody req =
login <- signInRole (cs $ userId u)
(cs $ userPass u)
case login of
LoginSuccess role ->
LoginSuccess role uid ->
return $ responseLBS status201 [ jsonH ] $
encode . object $ [("token", String $ tokenJWT jwtSecret (cs $ userId u) role)]
encode . object $ [("token", String $ tokenJWT jwtSecret uid role)]
_ -> return $ responseLBS status401 [jsonH] $
encode . object $ [("message", String "Failed authentication.")]