Consistent spacing in servant-client
This commit is contained in:
parent
4ecbf2f1b8
commit
5bf9e62244
1 changed files with 5 additions and 6 deletions
|
@ -19,13 +19,12 @@ import Servant.Common.Req (addHeader, Req)
|
||||||
class AuthenticateRequest a where
|
class AuthenticateRequest a where
|
||||||
authReq :: a -> Req -> Req
|
authReq :: a -> Req -> Req
|
||||||
|
|
||||||
|
|
||||||
instance AuthenticateRequest (BasicAuth realm) where
|
instance AuthenticateRequest (BasicAuth realm) where
|
||||||
authReq (BasicAuth user pass) req =
|
authReq (BasicAuth user pass) req =
|
||||||
let authText = decodeUtf8 ("Basic " <> encode (user <> ":" <> pass)) in
|
let authText = decodeUtf8 ("Basic " <> encode (user <> ":" <> pass))
|
||||||
addHeader "Authorization" authText req
|
in addHeader "Authorization" authText req
|
||||||
|
|
||||||
instance AuthenticateRequest JWTAuth where
|
instance AuthenticateRequest JWTAuth where
|
||||||
authReq (JWTAuth token) req =
|
authReq (JWTAuth token) req =
|
||||||
let authText = ("Bearer " <> token)
|
let authText = ("Bearer " <> token)
|
||||||
in addHeader "Authorization" authText req
|
in addHeader "Authorization" authText req
|
||||||
|
|
Loading…
Reference in a new issue