From e99db85febcd380f4187c223784f5dc9f6a01f86 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 11 May 2023 14:44:45 -0500 Subject: [PATCH] Add validation status to `checkuser` --- src/ZGoBackend.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 56bbff3..244eed1 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -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"