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

setCookie used fixed key "JWTToken" #174

Closed
newly12 opened this issue Sep 29, 2018 · 4 comments · Fixed by #175
Closed

setCookie used fixed key "JWTToken" #174

newly12 opened this issue Sep 29, 2018 · 4 comments · Fixed by #175
Assignees
Labels

Comments

@newly12
Copy link

newly12 commented Sep 29, 2018

hi,

I have some questions..

  • can this be configurable
	// set cookie
	if mw.SendCookie {
		maxage := int(expire.Unix() - time.Now().Unix())
		c.SetCookie(
			"JWTToken",
			tokenString,
			maxage,
			"/",
			mw.CookieDomain,
			mw.SecureCookie,
			mw.CookieHTTPOnly,
		)
	}
  • in example, cookie is named as "jwt", kind of confusing and when copy the example code, it takes time to find out this inconsistence.
		TokenLookup: "header: Authorization, query: token, cookie: jwt",
@appleboy appleboy self-assigned this Sep 29, 2018
@appleboy appleboy added the bug label Sep 29, 2018
@appleboy
Copy link
Owner

I will take it.

@appleboy
Copy link
Owner

Already add CookieName in jwt package.

@appleboy
Copy link
Owner

@newly12

gin-jwt/auth_jwt.go

Lines 126 to 127 in 7e28a7a

// CookieName allow cookie name change for development
CookieName string

@newly12
Copy link
Author

newly12 commented Sep 30, 2018

@appleboy thanks for the prompt action

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

Successfully merging a pull request may close this issue.

2 participants