auth

package
v0.0.0-...-f3fb216 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHashAndPassword

func CompareHashAndPassword(hashed string, password string) bool

func GenerateFromPassword

func GenerateFromPassword(password string) string

func GenerateJwtToken

func GenerateJwtToken(user models.User) (string, error)

Types

type User

type User struct {
	ID       int       `json:"id"`
	Username string    `json:"username"`
	Roles    []string  `json:"roles"`
	Expires  time.Time `json:"expires"`
}

func GetUser

func GetUser(c *gin.Context) (User, bool)

func ParseJwtToken

func ParseJwtToken(authHeader string) (User, bool)

Jump to

Keyboard shortcuts

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