Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckAuthHandler ¶
func CheckAuthHandler(w http.ResponseWriter, r *http.Request)
CheckAuthHandler validate jwt in cookies, response 401 when invalid
func InitParams ¶
func InitParams()
func LoginHandler ¶
func LoginHandler(w http.ResponseWriter, r *http.Request)
Types ¶
type JWTManager ¶
type JWTManager struct {
// contains filtered or unexported fields
}
func NewJWTManager ¶
func NewJWTManager(secretKey []byte, maxAge int) *JWTManager
func (*JWTManager) GenerateToken ¶
func (jm *JWTManager) GenerateToken(uid string) string
Click to show internal directories.
Click to hide internal directories.