auth

package
v0.0.0-...-c11cb33 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(user *models.User) (string, string, error)

Types

type Payload

type Payload struct {
	UserID   primitive.ObjectID `json:userID`
	Username string             `json:username`
	Role     string             `json:role`
	jwt.StandardClaims
}

func ValidateToken

func ValidateToken(token string) (*Payload, error)

Jump to

Keyboard shortcuts

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