Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajermaky committed Oct 31, 2021
1 parent 25379bc commit edf4019
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion parser_test.go
Expand Up @@ -494,7 +494,6 @@ func TestSetPadding(t *testing.T) {
data.tokenString = signToken(data.claims, data.signingMethod)

}
fmt.Println(data.tokenString)

// Parse the token
var token *jwt.Token
Expand Down
6 changes: 1 addition & 5 deletions token.go
Expand Up @@ -17,17 +17,13 @@ const (
var decodePaddingAllowed uint64

// SetDecodePadding will switch the codec used for encoding/decoding JWTs respectively. Note that the JWS RFC7515
// states that the tokens will utilize a Base64url encoding with no padding. Unfortuneately, some implementations
// states that the tokens will utilize a Base64url encoding with no padding. Unfortunately, some implementations
// of JWT are producing non-standard tokens, and thus require support for decoding. Note that this is a global
// variable, and updating it will change the behavior on a package level.
func SetDecodePadding(setPadding uint64) {
atomic.SwapUint64(&decodePaddingAllowed, setPadding)
}

func init() {
SetDecodePadding(DisablePadding)
}

// TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time).
// You can override it to use another time value. This is useful for testing or if your
// server uses a different time zone than your tokens.
Expand Down

0 comments on commit edf4019

Please sign in to comment.