auth

package
v0.0.0-...-9528f6d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(c *gin.Context) (*jwt.RegisteredClaims, bool)

CheckToken check the Request token

func MustUID

func MustUID(c *gin.Context) int

MustUID get the user ID from current request token, panic if unauthorized

func SignToken

func SignToken(uid int) (string, error)

SignToken generate JWT token

func VerifyToken

func VerifyToken(tokenString string) (*jwt.RegisteredClaims, error)

VerifyToken verify JWT token

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL