matebeamter/src/ClientAuth.hs

16 lines
411 B
Haskell
Raw Permalink Normal View History

2019-09-18 13:24:23 +00:00
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedStrings #-}
module ClientAuth where
import Servant.API (AuthProtect)
import Servant.Client.Core
2024-02-28 10:56:38 +00:00
type instance AuthClientData (AuthProtect "Bearer") = String
2019-09-18 13:24:23 +00:00
authenticateReq :: String -> Request -> Request
2024-02-28 10:56:38 +00:00
authenticateReq = addHeader "Bearer"
2019-11-09 11:29:29 +00:00
nonAuthenticateRequest :: String -> Request -> Request
nonAuthenticateRequest _ = id