diff --git a/auth/jwt/jwt.go b/auth/jwt/jwt.go index 49e1ff19..4db68d61 100644 --- a/auth/jwt/jwt.go +++ b/auth/jwt/jwt.go @@ -52,7 +52,6 @@ func (s *svc) Init(opts ...auth.Option) error { // AuthClaims to be encoded in the JWT type AuthClaims struct { - Id string `json:"id"` Roles []*auth.Role `json:"roles"` Metadata map[string]string `json:"metadata"` @@ -74,7 +73,7 @@ func (s *svc) Generate(id string, ops ...auth.GenerateOption) (*auth.Account, er options := auth.NewGenerateOptions(ops...) account := jwt.NewWithClaims(jwt.SigningMethodRS256, AuthClaims{ - id, options.Roles, options.Metadata, jwt.StandardClaims{ + options.Roles, options.Metadata, jwt.StandardClaims{ Subject: id, ExpiresAt: options.Expiry.Unix(), }, @@ -127,7 +126,7 @@ func (s *svc) Verify(token string) (*auth.Account, error) { } return &auth.Account{ - Id: claims.Id, + Id: claims.Subject, Metadata: claims.Metadata, Roles: claims.Roles, }, nil