auth

package
v3.13.4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateToken added in v3.13.3

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
}

type Controller

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

func NewController

func NewController(repository authRepository, sender recoveryEmail, cfg Config, printers map[string]*message.Printer) *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