diff options
| author | LLLL Colonq <llll@colonq> | 2025-05-30 02:55:35 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2025-05-30 02:55:55 -0400 |
| commit | f95d9bbde51ee26468177b2d34c669d9689fbea4 (patch) | |
| tree | 9790f7a39c70e1cc2c6a0d418ace38dcf7a1aa51 /fig-web/src/Fig/Web/Utils.hs | |
| parent | bab19289fd0b0f7a26056c4f20b5a0f456c9bf57 (diff) | |
web: Big refactor part 2
Diffstat (limited to 'fig-web/src/Fig/Web/Utils.hs')
| -rw-r--r-- | fig-web/src/Fig/Web/Utils.hs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/fig-web/src/Fig/Web/Utils.hs b/fig-web/src/Fig/Web/Utils.hs index ee7fdf7..fbe17bf 100644 --- a/fig-web/src/Fig/Web/Utils.hs +++ b/fig-web/src/Fig/Web/Utils.hs @@ -12,8 +12,6 @@ module Fig.Web.Utils , queryParam, queryParamMaybe, formParam, formParamMaybe, pathParam , header , respondText, respondJSON, respondHTML - , Credentials(..) - , authed , WebsocketHandler , websocket , BusEventHandler, BusEventHandlers @@ -151,22 +149,6 @@ respondJSON = Sc.json respondHTML :: Text -> Sc.ActionM () respondHTML = Sc.html . Text.L.fromStrict -data Credentials = Credentials - { user :: Text - , email :: Text - } -authed :: (Credentials -> Sc.ActionM ()) -> Sc.ActionM () -authed h = do - muser <- header "Remote-User" - memail <- header "Remote-Email" - case (muser, memail) of - (Just user, Just email) -> do - let auth = Credentials{..} - h auth - _else -> do - status status401 - respondText "you're not logged in buddy (this is probably a bug, go message clonk)" - type WebsocketHandler = (ByteString, WS.Connection -> IO ()) websocket :: [WebsocketHandler] -> Sc.ScottyM () websocket hs = Sc.middleware $ Wai.WS.websocketsOr WS.defaultConnectionOptions handler |
