Skip to content

Commit

Permalink
bearer: fix docstring (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon authored Dec 14, 2023
1 parent b2770f3 commit b5645ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bearer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var bearerPrefix = "Bearer "
// Token is the authenticated token that was extracted from the request.
type Token string

// Bearer returns a middleware handler that injects auth.User (empty string)
// Bearer returns a middleware handler that injects auth.Token
// into the request context upon successful bearer authentication. The handler
// responds http.StatusUnauthorized when authentication fails.
func Bearer(token string) flamego.Handler {
Expand All @@ -29,7 +29,7 @@ func Bearer(token string) flamego.Handler {
})
}

// BearerFunc returns a middleware handler that injects auth.User (empty string)
// BearerFunc returns a middleware handler that injects auth.Token
// into the request context upon successful bearer authentication with the given
// function. The function should return true for a valid bearer token.
func BearerFunc(fn func(token string) bool) flamego.Handler {
Expand Down

0 comments on commit b5645ff

Please sign in to comment.