app

package
v0.0.0-...-f70499c Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UserContextKey   = contextKey("user")
	BrokerContextKey = contextKey("sseBroker")
)
View Source
var (
	ErrSessionNotFound              = errors.New("session not found")
	ErrUserNotFound                 = errors.New("user not found")
	ErrUserDeactivated              = errors.New("user is deactivated")
	ErrEmailIsTaken                 = errors.New("email is taken")
	ErrPasswordIncorrect            = errors.New("password is incorrect")
	ErrChannelNotFound              = errors.New("channel not found")
	ErrMemberNotFound               = errors.New("member not found")
	ErrFieldVerificationNotFound    = errors.New("field verification not found")
	ErrFieldVerificationCodeInvalid = errors.New("field verification code invalid")
	ErrUnsupportedValidationField   = errors.New("unsupported verification field")
	ErrUserHasNoPassword            = errors.New("user has no password")
)

Functions

func BuildGravatar

func BuildGravatar(email string) string

func ContextWithUser

func ContextWithUser(ctx context.Context, user model.User) context.Context

func GenerateOTP

func GenerateOTP(length int) (string, error)

func GetUserFromContextOrPanic

func GetUserFromContextOrPanic(ctx context.Context) model.User

func IsHtmxRequest

func IsHtmxRequest(r *http.Request) bool

func Redirect

func Redirect(w http.ResponseWriter, r *http.Request, location string)

func RedirectWithReturnURL

func RedirectWithReturnURL(w http.ResponseWriter, r *http.Request, location, returnUrl string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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