From 89638019139dd73fc4fa120e5b58937f20ee943a Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Fri, 8 Nov 2024 02:47:09 -0500 Subject: Unauthorized page --- fig-web/src/Fig/Web.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fig-web/src') diff --git a/fig-web/src/Fig/Web.hs b/fig-web/src/Fig/Web.hs index 60dbbe7..b227911 100644 --- a/fig-web/src/Fig/Web.hs +++ b/fig-web/src/Fig/Web.hs @@ -74,6 +74,12 @@ app cfg cmds liveEvents currentlyLive = do Sc.scottyApp do -- Sc.middleware $ Wai.Static.staticPolicy $ Wai.Static.addBase cfg.assetPath Sc.get "/" $ Sc.redirect "/index.html" + Sc.get "/unauthorized" do + Sc.status status401 + Sc.text $ mconcat + [ "your request was rejected because that endpoint requires authentication\n" + , "you can log in by POSTing your credentials to https://auth.colonq.computer/api/firstfactor\n" + ] Sc.get "/api/check" $ authed cfg \auth -> do Sc.json @[Text] [auth.id, auth.name] Sc.put "/api/buffer" do -- cgit v1.2.3