authorized

package
v0.0.0-...-f926c12 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateJWT

func GenerateJWT(userName string) (string, error)

func GetTokenClaims

func GetTokenClaims(c *gin.Context) (jwt.MapClaims, bool)

func Init

func Init(r *gin.Engine)

func IsAuthorized

func IsAuthorized(endpoint func(c *gin.Context)) func(c *gin.Context)

func SetHTTPOnlyToken

func SetHTTPOnlyToken(c *gin.Context, userName string)

Types

type LoginData

type LoginData struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type LoginDto

type LoginDto struct {
	Login bool `json:"login"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

Jump to

Keyboard shortcuts

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