Documentation ¶
Index ¶
- Constants
- func AuthMiddleware(next http.Handler) http.Handler
- func NewAccessToken(claims UserClaims, secret string) (string, error)
- func NewRefreshToken(claims jwt.StandardClaims, secret string) (string, error)
- func ParseRefreshToken(refreshToken string, secret string) *jwt.StandardClaims
- func Router() chi.Router
- type RefreshToken
- type UserAuth
- type UserClaims
Constants ¶
View Source
const ( ACCESS_TOKEN = "access-token" REFRESH_TOKEN = "refresh-token" )
Variables ¶
This section is empty.
Functions ¶
func NewAccessToken ¶
func NewAccessToken(claims UserClaims, secret string) (string, error)
func NewRefreshToken ¶
func NewRefreshToken(claims jwt.StandardClaims, secret string) (string, error)
func ParseRefreshToken ¶
func ParseRefreshToken(refreshToken string, secret string) *jwt.StandardClaims
Types ¶
type RefreshToken ¶
type RefreshToken string
type UserClaims ¶
type UserClaims struct { Nickname string `json:"nickname"` //User models.User `json:"user"` jwt.StandardClaims }
func ParseAccessToken ¶
func ParseAccessToken(accessToken string, secret string) *UserClaims
Click to show internal directories.
Click to hide internal directories.