on master help sign in
Update Authentication.lhs
f352f3bRuben Moor
doc/tutorial/Authentication.lhs+3−1
@@ -409,13 +409,15 @@ marshal an unauthenticated request into an authenticated request. Generally,
409this will look like:
409this will look like:
410
410
411```haskell ignore
411```haskell ignore
412+import Servant.Common.Req (Req, addHeader)
413+
412-- | The datatype we'll use to authenticate a request. If we were wrapping
414-- | The datatype we'll use to authenticate a request. If we were wrapping
413-- something like OAuth, this might be a Bearer token.
415-- something like OAuth, this might be a Bearer token.
414type instance AuthClientData (AuthProtect "cookie-auth") = String
416type instance AuthClientData (AuthProtect "cookie-auth") = String
415
417
416-- | A method to authenticate a request
418-- | A method to authenticate a request
417authenticateReq :: String -> Req -> Req
419authenticateReq :: String -> Req -> Req
418−authenticateReq s req = SCR.addHeader "my-bespoke-header" s req
420+authenticateReq s req = addHeader "my-bespoke-header" s req
419```
421```
420
422
421Now, if the client method for our protected endpoint was `getProtected`, then
423Now, if the client method for our protected endpoint was `getProtected`, then