Documentation
¶
Index ¶
- Variables
- func GenerateAllTokens(email, firstName, lastName, role, userId string) (string, string, error)
- func GetAccessToken(c *gin.Context) (string, error)
- func GetRoleFromContext(c *gin.Context) (string, error)
- func GetUserIdFromContext(c *gin.Context) (string, error)
- func UpdateAllTokens(userId, token, refreshToken string, client *mongo.Client, c *gin.Context) (err error)
- type SignedDetails
Constants ¶
This section is empty.
Variables ¶
View Source
var SECRET_KEY string = os.Getenv("SECRET_KEY")
View Source
var SECRET_REFRESH_KEY string = os.Getenv("SECRET_REFRESH_KEY")
Functions ¶
func GenerateAllTokens ¶
Types ¶
type SignedDetails ¶
type SignedDetails struct {
Email string
FirstName string
LastName string
Role string
UserId string
jwt.RegisteredClaims
}
func ValidateRefreshToken ¶
func ValidateRefreshToken(tokenString string) (*SignedDetails, error)
func ValidateToken ¶
func ValidateToken(tokenString string) (*SignedDetails, error)
Click to show internal directories.
Click to hide internal directories.