auth

package
v0.0.0-...-ae54a69 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	JwtKey = []byte(config.Get().SecretKey)
)

Functions

func CheckPasswordHash

func CheckPasswordHash(pwd, hash string) bool

func HashPassword

func HashPassword(password string) string

func Init

func Init()

Types

type Account

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

func (*Account) GetJwtToken

func (acc *Account) GetJwtToken() (string, error)

func (*Account) Login

func (acc *Account) Login() bool

type Claims

type Claims struct {
	UserID string
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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