zrhoffman commented on a change in pull request #6641:
URL: https://github.com/apache/trafficcontrol/pull/6641#discussion_r827336659
##########
File path: traffic_ops/traffic_ops_golang/api/api.go
##########
@@ -1112,21 +1113,15 @@ func GetUserFromReq(w http.ResponseWriter, r
*http.Request, secret string) (auth
func getCookieFromAccessToken(bearerToken string, secret string)
(*http.Cookie, error) {
var cookie *http.Cookie
- claims := jwt.MapClaims{}
- token, err := jwt.ParseWithClaims(bearerToken, claims, func(token
*jwt.Token) (interface{}, error) {
- return []byte(secret), nil
- })
+ token, err := jwt.Parse([]byte(bearerToken), jwt.WithVerify(jwa.HS256,
[]byte(secret)))
if err != nil {
- return nil, fmt.Errorf("parsing claims: %w", err)
+ return nil, fmt.Errorf("invalid token: %s", err)
Review comment:
Wrapping error in 1ef4cfe407
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]