auth

package
v0.0.0-...-a929f0c Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRoute

func AuthRoute(route fiber.Router, db *gorm.DB)

func GenerateJWTToken

func GenerateJWTToken(userID uint) (string, error)

Types

type Handler

type Handler struct {
	DB *gorm.DB
}

func (Handler) AddUser

func (h Handler) AddUser(c *fiber.Ctx) error

func (Handler) HandleLogin

func (h Handler) HandleLogin(c *fiber.Ctx) error

func (Handler) HandleLogout

func (h Handler) HandleLogout(c *fiber.Ctx) error

type LoginUser

type LoginUser struct {
	Email     string    `json:"email"`
	Username  string    `json:"username"`
	CreatedAt time.Time `json:"createdAt"`
	ID        uint      `json:"id"`
}

type UserSchema

type UserSchema struct {
	Email    string `json:"email"`
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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