auth

package
v0.0.0-...-f1d4120 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HtmxRedirect

func HtmxRedirect(c echo.Context, path string) error

func HtmxRender

func HtmxRender(c echo.Context, htmxTemplate TemplRenderFunc, nonHtmxTemplate TemplRenderFunc) templ.Component

func IsHtmxRequest

func IsHtmxRequest(c echo.Context) bool

func Render

func Render(ctx echo.Context, status int, t templ.Component) error

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func New

func New(options ...Option) *Auth

func (*Auth) AuthGuardMiddleware

func (a *Auth) AuthGuardMiddleware() echo.MiddlewareFunc

func (*Auth) LoadAuthContextFromCookieMiddleware

func (a *Auth) LoadAuthContextFromCookieMiddleware(app core.App) echo.MiddlewareFunc

func (*Auth) Login

func (a *Auth) Login(e *core.ServeEvent, c echo.Context, username string, password string) error

func (*Auth) Register

func (a *Auth) Register(e *core.ServeEvent, c echo.Context, username string, password string, passwordRepeat string) error

func (*Auth) RegisterLoginRoutes

func (a *Auth) RegisterLoginRoutes(e *core.ServeEvent, group echo.Group)

func (*Auth) RegisterRegisterRoutes

func (a *Auth) RegisterRegisterRoutes(e *core.ServeEvent, group echo.Group)

type Config

type Config struct {
	TableName         string
	AuthCookieName    string
	LoginPath         string
	RegisterPath      string
	LogoutPath        string
	RedirectPath      string
	RedirectLoginPath string
	Login             Login
	LoginForm         LoginForm
	Register          Register
	RegisterForm      RegisterForm
}

type Login

type Login func(error) templ.Component

type LoginForm

type LoginForm func(error) templ.Component

type LoginFormValue

type LoginFormValue struct {
	// contains filtered or unexported fields
}

func (LoginFormValue) Validate

func (lfv LoginFormValue) Validate() error

type Option

type Option func(cfg *Config)

type Register

type Register func(error) templ.Component

type RegisterForm

type RegisterForm func(error) templ.Component

type RegisterFormValue

type RegisterFormValue struct {
	// contains filtered or unexported fields
}

func (RegisterFormValue) Validate

func (lfv RegisterFormValue) Validate() error

type TemplRenderFunc

type TemplRenderFunc func() templ.Component

type Users

type Users struct {
	models.Record
}

Jump to

Keyboard shortcuts

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