Merge pull request #130 from ChenHaoHu/master

bugfix: fix auth check return error msg
This commit is contained in:
lanyulei 2021-02-18 19:20:00 +08:00 committed by GitHub
commit d5e6d31d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -608,7 +608,7 @@ func (mw *GinJWTMiddleware) jwtFromHeader(c *gin.Context, key string) (string, e
parts := strings.SplitN(authHeader, " ", 2)
if !(len(parts) == 2 && parts[0] == mw.TokenHeadName) {
return "", ErrInvalidAuthHeader
return "-", ErrInvalidAuthHeader
}
return parts[1], nil