Documentation ¶
Overview ¶
Package tokenutils provides utilities for JWTs
Index ¶
- func ExtractRefreshToken(r *http.Request) string
- func ExtractToken(r *http.Request) string
- func ExtractUserId(r *http.Request) uint
- func RefreshAccessToken(refreshToken *jwt.Token) (string, error)
- func StillValid(token *jwt.Token) bool
- func VerifyRefreshToken(r *http.Request) (*jwt.Token, error)
- func VerifyToken(r *http.Request) (*jwt.Token, error)
- type Claims
- type Tokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractRefreshToken ¶
func ExtractToken ¶
ExtractToken extracts an access token from request header
func ExtractUserId ¶
func StillValid ¶
func VerifyRefreshToken ¶
VerifyRefreshToken verifies a refresh token is legit
Types ¶
type Claims ¶
type Claims struct { UserId uint `json:"userid"` // User ID jwt.StandardClaims }
Claims holds a UserId and standard claims
Click to show internal directories.
Click to hide internal directories.