Documentation ¶
Index ¶
- func CreateToken(user models.User) (signedToken string, err error)
- func ExtractTokenID(r *http.Request) (uint, error)
- func Extractoken(r *http.Request) string
- func Pretty(data interface{})
- func RefreshToken(user models.User) (signedtoken string, err error)
- func ValidateToken(r *http.Request) error
- type JwtClaim
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
GenerateToken generates a JWT token GenerateToken takes an email as an argument and returns a signed JWT token and an error
func ExtractTokenID ¶
ExtractTokenID extracts the token id from the http request r: the http request returns: the token id and an error if any
func Extractoken ¶
ExtractToken extracts the token from the http request r: the http request returns: the token string
func Pretty ¶
func Pretty(data interface{})
Pretty display the claims licely in the terminal data: the data to be displayed
func RefreshToken ¶
RefreshToken generates a refresh jwt token RefreshToken takes an email as an argument and returns a signed JWT token and an error
func ValidateToken ¶
ValidateToken validates the JWT token ValidateToken takes a signed JWT token as an argument and returns the JwtClaim and an error