Skip to content

Commit

Permalink
Mention AuthMiddleware requirement (http4s#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuwy committed Oct 29, 2018
1 parent f67eed3 commit 945a4aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/org/http4s/rho/AuthedContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import org.http4s.rho.bits.{FailureResponseOps, SuccessResponse, TypedHeader}

/** The [[AuthedContext]] provides a convenient way to define a RhoRoutes
* which works with http4s authentication middleware.
* Please note that `AuthMiddleware`-wrapping is mandatory, otherwise context
* doesn't take effect.
* {{{
* case class User(name: String, id: UUID)
*
Expand Down Expand Up @@ -48,7 +50,7 @@ class AuthedContext[F[_]: Monad, U] extends FailureResponseOps[F] {
}
}

/** Get the authInfo object from request */
/** Get the authInfo object from request if `AuthMiddleware` provided one */
def getAuth(req: Request[F]): Option[U] =
req.attributes.get(authKey)

Expand Down

0 comments on commit 945a4aa

Please sign in to comment.