auth

package
v0.0.0-...-3719db4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinPasswordLength int = 8
)

Variables

View Source
var (
	ErrNoToken          = errors.New("no token context")
	ErrInvalidToken     = errors.New("invalid token")
	ErrInvalidClaimUser = errors.New("invalid claim userId")
	ErrSessionUser      = errors.New("invalid session user")
)
View Source
var (
	ErrPasswordResetExpired = errors.New("password reset link is expired")
)

Functions

func Authenticator

func Authenticator(next http.Handler) http.Handler

Authenticator enforces the validity of the jwt token.

func SessionCtx

func SessionCtx(next http.Handler) http.Handler

func Signup

func Signup(w http.ResponseWriter, r *http.Request)

Signup creates a new user

func VerifyPassword

func VerifyPassword(hash, password string) bool

bcrypt compare hash with given password

Types

This section is empty.

Jump to

Keyboard shortcuts

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