restMiddleware

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	Cfg       *config.ServiceConfig
	DBRepo    repositories.DBRepo
	UtilsRepo repositories.UtilsRepo
}

func New

func New(this *Middleware) *Middleware

func (*Middleware) Authorize

func (m *Middleware) Authorize(h fiber.Handler) fiber.Handler

func (*Middleware) GetDataUser

func (m *Middleware) GetDataUser(ctx *fiber.Ctx) (result MyClaims)

type MyClaims

type MyClaims struct {
	jwt.StandardClaims
	Email    string `json:"email"`
	Password string `json:"password"`
}

MyClaims Create a struct that will be encoded to a JWT. We add jwt.StandardClaims as an embedded type, to provide fields like expiry time

Jump to

Keyboard shortcuts

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