From 58386171502ba911b6d71cddf424ceca03fa4054 Mon Sep 17 00:00:00 2001 From: Ara Jermakyan Date: Sat, 30 Oct 2021 18:31:26 -0700 Subject: [PATCH] Revert encoding changes and keep decoding --- token.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token.go b/token.go index d8c10e06..a5e25904 100644 --- a/token.go +++ b/token.go @@ -104,7 +104,7 @@ func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options // Deprecated: In a future release, we will demote this function to a non-exported function, since it // should only be used internally func EncodeSegment(seg []byte) string { - return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=") + return strings.TrimRight(base64.RawURLEncoding.EncodeToString(seg), "=") } // DecodeSegment decodes a JWT specific base64url encoding with padding stripped