Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to retrieve JWT from a query and cookie with a specified name #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JunNishimura
Copy link

Fixes #88

  1. I defined the function TokenFromCookieWith to retrieve jwt from a cookie with a name passed as an argument.
  2. I defined the function TokenFromQueryWith to retrieve jwt from a query with a name passed as an argument.

How to Use

func Verifier(ja *JWTAuth) func(http.Handler) http.Handler {
	return func(next http.Handler) http.Handler {
		return Verify(ja, TokenFromQueryWith("custom-param"), TokenFromHeader, TokenFromCookieWith("custom-cookie"))(next)
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow users to retrieve JWT from a query and cookie with a specified name
1 participant