Add validation status to checkuser
This commit is contained in:
parent
04e0638752
commit
e99db85feb
1 changed files with 2 additions and 1 deletions
|
@ -847,10 +847,11 @@ routes pipe config = do
|
||||||
get "/checkuser" $ do
|
get "/checkuser" $ do
|
||||||
sess <- param "session"
|
sess <- param "session"
|
||||||
user <- liftAndCatchIO $ run (findUser sess)
|
user <- liftAndCatchIO $ run (findUser sess)
|
||||||
case user of
|
case parseUserBson =<< user of
|
||||||
Nothing -> status noContent204
|
Nothing -> status noContent204
|
||||||
Just u -> do
|
Just u -> do
|
||||||
status ok200
|
status ok200
|
||||||
|
Web.Scotty.json (object ["validated" .= uvalidated u])
|
||||||
--Get user associated with session
|
--Get user associated with session
|
||||||
get "/api/user" $ do
|
get "/api/user" $ do
|
||||||
sess <- param "session"
|
sess <- param "session"
|
||||||
|
|
Loading…
Reference in a new issue