auth

package
v0.0.0-...-5d17f3a Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

jwt.go

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 int) (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, requiredRoles ...string) 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