auth

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWTAuth

type JWTAuth struct {
	ID       uint   `json:"id"`
	Name     string `json:"name"`
	Surname  string `json:"surname"`
	Username string `json:"username"`
	Password string `json:"password"`
}

JWTAuth structure will be used to handle the authenticated user data.

func (*JWTAuth) GetUser

func (c *JWTAuth) GetUser(req *http.Request, key string) error

GetUser will parse incoming request and returns the user data.

func (*JWTAuth) NewToken

func (c *JWTAuth) NewToken(key string, duration time.Duration) (string, bool)

NewToken will return a new JWT token

func (*JWTAuth) RefreshToken

func (c *JWTAuth) RefreshToken(req http.ResponseWriter, key string) bool

RefreshToken will refresh JWT token

Jump to

Keyboard shortcuts

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