Skip to content

Commit

Permalink
Merge pull request #61 from TBD54566975/kendallw/jwt-claims-int64
Browse files Browse the repository at this point in the history
Change JWT Claims from uint64 to int64 #39
  • Loading branch information
KendallWeihe authored Feb 20, 2024
2 parents b56de28 + bc6b3d3 commit d8f9640
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jwt/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type Decoded struct {

// Verify verifies a JWT (JSON Web Token)
func (jwt Decoded) Verify() error {
if jwt.Claims.Expiration != 0 && time.Now().Unix() > int64(jwt.Claims.Expiration) {
if jwt.Claims.Expiration != 0 && time.Now().Unix() > jwt.Claims.Expiration {
return errors.New("JWT has expired")
}

Expand Down Expand Up @@ -150,19 +150,19 @@ type Claims struct {
// or after which the JWT must not be accepted for processing.
//
// Spec: https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4
Expiration uint64 `json:"exp,omitempty"`
Expiration int64 `json:"exp,omitempty"`

// The "nbf" (not before) claim identifies the time before which the JWT
// must not be accepted for processing.
//
// Spec: https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5
NotBefore uint64 `json:"nbf,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`

// The "iat" (issued at) claim identifies the time at which the JWT was
// issued.
//
// Spec: https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6
IssuedAt uint64 `json:"iat,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`

// The "jti" (JWT ID) claim provides a unique identifier for the JWT.
//
Expand Down

0 comments on commit d8f9640

Please sign in to comment.