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

fix: custom KeyFunc doesn't useful #19

Closed
wants to merge 1 commit into from

Conversation

Skyenought
Copy link
Member

What type of PR is this?

fix

What this PR does / why we need it (English/Chinese):

zh: 修复 KeyFunc 在实际使用不起作用的问题

Which issue(s) this PR fixes:

#18

auth_jwt.go Show resolved Hide resolved
auth_jwt.go Outdated
@@ -630,7 +635,8 @@ func (mw *HertzJWTMiddleware) RefreshToken(ctx context.Context, c *app.RequestCo
func (mw *HertzJWTMiddleware) CheckIfTokenExpire(ctx context.Context, c *app.RequestContext) (jwt.MapClaims, error) {
token, err := mw.ParseToken(ctx, c)
if err != nil {
validationErr, ok := err.(*jwt.ValidationError)
var validationErr *jwt.ValidationError

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的改动没看懂作用

@Skyenought Skyenought force-pushed the sec branch 2 times, most recently from 1f37d8e to 6feac52 Compare October 3, 2023 15:32
if err != nil {
return "", err
}
tokenString, err = token.SignedString(key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

mw.KeyFunc != ni 场景下 usingPublicKeyAlgo 开关失效

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@li-jin-gou
按照 KeyFunc 的注释, 其他的设置就是会失效的

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.

2 participants