utils

package
v0.0.0-...-52377f7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizeRoute

func AuthorizeRoute(c *fiber.Ctx) bool

func NewError

func NewError(msg string) fiber.Map

func NewJWTSignedToken

func NewJWTSignedToken(claims jwt.Claims) (string, error)

func UnauthorizedResponse

func UnauthorizedResponse(c *fiber.Ctx) error

Types

type AuthInfo

type AuthInfo struct {
	Authorized bool
	User       models.User
}

func GetAuthInfo

func GetAuthInfo(c *fiber.Ctx) AuthInfo

type LoginClaims

type LoginClaims struct {
	jwt.StandardClaims

	User models.User `json:"user"`
}

func ValidateJWTSignedToken

func ValidateJWTSignedToken(token string) (bool, LoginClaims, error)

Jump to

Keyboard shortcuts

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