mirror of
https://github.com/amitshekhariitbhu/go-backend-clean-architecture.git
synced 2026-04-27 05:25:51 +03:00
[PR #23] StandardClaims -> RegisteredClaims #23
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-backend-clean-architecture#23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/amitshekhariitbhu/go-backend-clean-architecture/pull/23
Author: @ShaysFrame
Created: 11/27/2025
Status: 🔄 Open
Base:
main← Head:fix/tokenutil-jwt-expires📝 Commits (1)
ac72f9d- error strings should not be capitalized (ST1005)📊 Changes
2 files changed (+11 additions, -10 deletions)
View changed files
📝
domain/jwt_custom.go(+2 -2)📝
internal/tokenutil/tokenutil.go(+9 -8)📄 Description
This pull request updates the JWT token handling to use the newer
jwt.RegisteredClaimsinstead of the deprecatedjwt.StandardClaims, and improves error message consistency. The main changes are focused on updating the claims structure and token creation logic, as well as standardizing error messages.JWT Claims Migration:
JwtCustomClaimsandJwtCustomRefreshClaimsstructs indomain/jwt_custom.goto usejwt.RegisteredClaimsinstead ofjwt.StandardClaims.Token Creation Logic:
CreateAccessTokenandCreateRefreshTokenininternal/tokenutil/tokenutil.goto usejwt.NewNumericDatewithjwt.RegisteredClaims. [1] [2]Error Message Consistency:
IsAuthorizedandExtractIDFromTokenmethods ininternal/tokenutil/tokenutil.go. [1] [2]ExtractIDFromToken.jwt.StandardClaims is deprecated: Use RegisteredClaims instead for a forward-compatible way to access registered claims in a struct.
error strings should not be capitalized (ST1005)
Removed the deprecated StandardClaims and updated to the recommended RegisteredClaims
Use jwt.NewNumericDate for expiry fields
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.