diff options
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 |
