forked from mirror/jwt
Update, use MapClaim by default.
This commit is contained in:
parent
a33fdf927a
commit
dfdafab9a7
4
jwt.go
4
jwt.go
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue