diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 99a6a49..e1e6749 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -844,13 +844,20 @@ routes pipe config = do status accepted202 Web.Scotty.json (object ["message" .= ("Incorrect plugin config" :: String)]) + get "/checkuser" $ do + sess <- param "session" + user <- liftAndCatchIO $ run (findUser sess) + case user of + Nothing -> status noContent204 + Just u -> status ok200 --Get user associated with session get "/api/user" $ do sess <- param "session" user <- liftAndCatchIO $ run (findUser sess) case user of Nothing -> status noContent204 - Just u -> + Just u -> do + status ok200 Web.Scotty.json (object [ "message" .= ("User found" :: String) @@ -891,7 +898,7 @@ routes pipe config = do status ok200 else status noContent204 --Get current blockheight from Zcash node - get "/api/blockheight" $ do + get "/blockheight" $ do blockInfo <- liftAndCatchIO $ makeZcashCall nodeUser nodePwd "getblock" ["-1"] let content = getResponseBody blockInfo :: RpcResponse Block @@ -902,7 +909,7 @@ routes pipe config = do else do status internalServerError500 --Get the ZGo node's shielded address - get "/api/getaddr" $ do Web.Scotty.json (object ["addr" .= nodeAddress]) + get "/getaddr" $ do Web.Scotty.json (object ["addr" .= nodeAddress]) --Get owner by address get "/api/owner" $ do addr <- param "address"