Skip to content

Commit

Permalink
Merge pull request #2624 from Tharsanan1/test-rc
Browse files Browse the repository at this point in the history
Fix padded jwt throwing invalid char error
  • Loading branch information
Krishanx92 authored Dec 10, 2024
2 parents da562da + 16ea1f1 commit c10446a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common-controller/internal/web/notify_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ func extractClaimsFromJWT(jwtToken string) (jWTClaims, error) {
loggers.LoggerAPI.ErrorC(logging.PrintError(logging.Error3205, logging.MAJOR, "Invalid JWT"))
return claims, fmt.Errorf("Invalid JWT token")
}
payload, err := base64.RawURLEncoding.DecodeString(parts[1])
payloadStr := strings.TrimRight(parts[1], "=")
payload, err := base64.RawURLEncoding.DecodeString(payloadStr)
if err != nil {
loggers.LoggerAPI.ErrorC(logging.PrintError(logging.Error3205, logging.MAJOR, "Invalid JWT"))
return claims, fmt.Errorf("Error decoding payload: %v", err)
Expand Down

0 comments on commit c10446a

Please sign in to comment.