Authentication

package
v0.0.0-...-f046a2d Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(id string, phone string, role string) (string, error)

func JWTAuthMiddleware

func JWTAuthMiddleware() gin.HandlerFunc

JWTAuthMiddleware is the middleware to authorize JWT tokens

func JWTClaims

func JWTClaims(tokenString, role string) (gin.H, error)

Types

type MyClaims

type MyClaims struct {
	jwt.StandardClaims
	ID    string `json:"id"`
	Phone string `json:"phone"`
	Role  string `json:"role"`
}

Jump to

Keyboard shortcuts

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