secret

package
v0.0.0-...-84b4eae Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTokenPair

func CreateTokenPair(conf *utils.ServerConfig, id string, issuer string) (string, time.Time, string, error)

func ErrorWriter

func ErrorWriter(c *gin.Context, code int, err error)

ErrorWriter set redirect header to index and show error message

func LoginHandler

func LoginHandler(cfg *utils.ServerConfig, db *datasource.DB) gin.HandlerFunc

func RefreshTokenHandler

func RefreshTokenHandler(cfg *utils.ServerConfig, db *datasource.DB) gin.HandlerFunc

RefreshTokenHandler will verify refresh_token is valid or not, then issue new Tokens if valid

func SignupHandler

func SignupHandler(cfg *utils.ServerConfig, db *datasource.DB) gin.HandlerFunc

Types

type Claims

type Claims struct {
	ID string `json:"id"`
	jwt.StandardClaims
}

Claims JWT claims

type RefClaims

type RefClaims struct {
	ID string `json:"id"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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