mirror of https://github.com/golang-jwt/jwt.git
Changed default "New" to use NewWithClaims internally.
This commit is contained in:
parent
22cba44699
commit
aa6ac13a18
9
jwt.go
9
jwt.go
|
@ -32,14 +32,7 @@ type Token struct {
|
||||||
|
|
||||||
// Create a new Token. Takes a signing method
|
// Create a new Token. Takes a signing method
|
||||||
func New(method SigningMethod) *Token {
|
func New(method SigningMethod) *Token {
|
||||||
return &Token{
|
return NewWithClaims(method, MapClaim{})
|
||||||
Header: map[string]interface{}{
|
|
||||||
"typ": "JWT",
|
|
||||||
"alg": method.Alg(),
|
|
||||||
},
|
|
||||||
Claims: MapClaim{},
|
|
||||||
Method: method,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWithClaims(method SigningMethod, claims Claims) *Token {
|
func NewWithClaims(method SigningMethod, claims Claims) *Token {
|
||||||
|
|
Loading…
Reference in New Issue