auth

package
v4.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(c fiber.Ctx, user *model.User, expiration time.Time, secret []byte) (string, error)

Types

type Config

type Config struct {
	Secret            []byte
	MinPasswordLength int
	Hostname          string
	Port              int
	SessionTimeout    time.Duration
	RecoveryTimeout   time.Duration
}

type Controller

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

func NewController

func NewController(repository authRepository, sender recoveryEmail, cfg Config, translator i18n.Translator) *Controller

func (*Controller) EditPassword

func (a *Controller) EditPassword(c fiber.Ctx) error

func (*Controller) Login

func (a *Controller) Login(c fiber.Ctx) error

func (*Controller) Recover

func (a *Controller) Recover(c fiber.Ctx) error

func (*Controller) Request

func (a *Controller) Request(c fiber.Ctx) error

func (*Controller) SignIn

func (a *Controller) SignIn(c fiber.Ctx) error

Signs in a user and gives them a JWT.

func (*Controller) SignOut

func (a *Controller) SignOut(c fiber.Ctx) error

Logs out user and removes their JWT.

func (*Controller) UpdatePassword

func (a *Controller) UpdatePassword(c fiber.Ctx) error

Jump to

Keyboard shortcuts

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