Update, use MapClaim by default.

This commit is contained in:
Jamie Stackhouse 2015-07-17 15:55:06 -03:00
parent a33fdf927a
commit dfdafab9a7
1 changed files with 2 additions and 2 deletions

4
jwt.go
View File

@ -217,7 +217,7 @@ func New(method SigningMethod) *Token {
"typ": "JWT", "typ": "JWT",
"alg": method.Alg(), "alg": method.Alg(),
}, },
Claims: Claims{}, Claims: MapClaim{},
Method: method, Method: method,
} }
} }
@ -274,7 +274,7 @@ func (t *Token) SigningString() (string, error) {
// keyFunc will receive the parsed token and should return the key for validating. // keyFunc will receive the parsed token and should return the key for validating.
// If everything is kosher, err will be nil // If everything is kosher, err will be nil
func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
return ParseWithClaims(tokenString, keyFunc, &Claims{}) return ParseWithClaims(tokenString, keyFunc, &MapClaim{})
} }
func ParseWithClaims(tokenString string, keyFunc Keyfunc, claims Claimer) (*Token, error) { func ParseWithClaims(tokenString string, keyFunc Keyfunc, claims Claimer) (*Token, error) {