Skip to content

Commit

Permalink
Merge pull request #293 from vsnaichuk/master
Browse files Browse the repository at this point in the history
Fix key for claims
  • Loading branch information
koddr authored Oct 28, 2024
2 parents 09e24ea + 4916ea2 commit f2fa44c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/jwt_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func generateNewAccessToken(id string, credentials []string) (string, error) {

// Set public claims:
claims["id"] = id
claims["expires"] = time.Now().Add(time.Minute * time.Duration(minutesCount)).Unix()
claims["exp"] = time.Now().Add(time.Minute * time.Duration(minutesCount)).Unix()
claims["book:create"] = false
claims["book:update"] = false
claims["book:delete"] = false
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/jwt_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ExtractTokenMetadata(c *fiber.Ctx) (*TokenMetadata, error) {
}

// Expires time.
expires := int64(claims["expires"].(float64))
expires := int64(claims["exp"].(float64))

// User credentials.
credentials := map[string]bool{
Expand Down

0 comments on commit f2fa44c

Please sign in to comment.