Documentation
¶
Overview ¶
Package jwt provides JWT token generation and validation for the application.
The module covers:
- token generation with HS256 algorithm,
- token validation and claims extraction,
- 24-hour token expiry,
- integration with the users domain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Claims ¶
type Claims struct {
jwt.RegisteredClaims
UserID int64 `json:"user_id"`
Role users.Role `json:"role"`
Status users.Status `json:"status"`
}
Claims represents the JWT token claims.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles JWT token operations.
func NewService ¶
NewService creates and initializes a new JWT service.
func (*Service) GenerateToken ¶
GenerateToken creates a new JWT token for the user.
Click to show internal directories.
Click to hide internal directories.