auth

package
v0.0.0-...-f3b85f2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractToken

func ExtractToken(c *gin.Context) string

func JwtAuthMiddleware

func JwtAuthMiddleware() gin.HandlerFunc

func TokenValid

func TokenValid(c *gin.Context) error

Types

type AuthDataHandler

type AuthDataHandler struct {
	Handler database.DatabaseHandler
}

func (AuthDataHandler) GenerateToken

func (adh AuthDataHandler) GenerateToken(userId uint) (string, error)

func (AuthDataHandler) VerifyLogin

func (adh AuthDataHandler) VerifyLogin(username string, password string) (string, error)

type AuthHandler

type AuthHandler interface {
	VerifyLogin(username string, password string) (string, error)
	GenerateToken(userId uint) (string, error)
}

func NewAuthHandler

func NewAuthHandler(databaseHandler database.DatabaseHandler) AuthHandler

Jump to

Keyboard shortcuts

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