Add validation status to checkuser

This commit is contained in:
Rene Vergara 2023-05-11 14:44:45 -05:00
parent 04e0638752
commit e99db85feb
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -847,10 +847,11 @@ routes pipe config = do
get "/checkuser" $ do
sess <- param "session"
user <- liftAndCatchIO $ run (findUser sess)
case user of
case parseUserBson =<< user of
Nothing -> status noContent204
Just u -> do
status ok200
Web.Scotty.json (object ["validated" .= uvalidated u])
--Get user associated with session
get "/api/user" $ do
sess <- param "session"