auth

package
v0.0.0-...-ebe49b8 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const UserKey contextKey = "userID"

Variables

This section is empty.

Functions

func ComparePasswords

func ComparePasswords(hashed string, plain []byte) bool

func CreateJWT

func CreateJWT(secret []byte, userID uuid.UUID) (string, error)

func GetUserIDFromContext

func GetUserIDFromContext(ctx context.Context) int

func HashPassword

func HashPassword(password string) (string, error)

func WithJWTAuth

func WithJWTAuth(handlerFunc http.HandlerFunc, store types.UserStore) http.HandlerFunc

Types

This section is empty.

Jump to

Keyboard shortcuts

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