This will successfully output a token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJmb28iLH0.x3KzbXc5PoGcb42h2vETFtGn5l1K3rhdJlQmgYGBR-k
Parsing the payload, the message looks like this
{"foo":"foo",}
This is not a valid json because it ends with ","
This causes the verify to return an error because the Json could not be parsed
jwt: payload is not a type of JSON
This only happens if MaxAge is not greater than 1 second
Reasons for speculation
I didn't do detailed testing, just inferred from the code
claims.go
MaxAge did not add the relevant information to the claims as the input time did not exceed 1 second
Situation
This will successfully output a token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmb28iOiJmb28iLH0.x3KzbXc5PoGcb42h2vETFtGn5l1K3rhdJlQmgYGBR-k
Parsing the payload, the message looks like this{"foo":"foo",}
This is not a valid json because it ends with "," This causes the verify to return an error because the Json could not be parsedjwt: payload is not a type of JSON
This only happens if MaxAge is not greater than 1 secondReasons for speculation
I didn't do detailed testing, just inferred from the code
claims.go
MaxAge did not add the relevant information to the claims as the input time did not exceed 1 second
Custom claims are added with "," at the end
This resulted in the wrong payload being generated