authUtils

package
v0.0.0-...-cd133ac Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentAuthUserId

func CurrentAuthUserId(ctx echo.Context) (uint64, error)

func CurrentUser

func CurrentUser(ctx echo.Context) uint64

func CurrentUserId

func CurrentUserId(ctx echo.Context) uint64

func CurrentVisitor

func CurrentVisitor(ctx echo.Context) (uint64, error)

func DecryptAES

func DecryptAES(key []byte, text string) string

func EncryptAES

func EncryptAES(key []byte, text string) string

func MakeJWTToken

func MakeJWTToken(userID uint64) (string, error)

func NewJWTMiddleware

func NewJWTMiddleware(secret string) echo.MiddlewareFunc

func NewTokenMiddleware

func NewTokenMiddleware(secret string) echo.MiddlewareFunc

func Pad

func Pad(src []byte) []byte

func SetAuthCookie

func SetAuthCookie(c echo.Context, token string)

func Unpad

func Unpad(src []byte) ([]byte, error)

Types

type JWTClaims

type JWTClaims struct {
	UserID uint64
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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