Add checkuser
endpoint
This commit is contained in:
parent
e80411d8bd
commit
f68675af03
1 changed files with 10 additions and 3 deletions
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue