auth

package
v0.0.0-...-4c047f0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenIsExpired = errors.New("token has expired")
	ErrTokenIsInvalid = errors.New("token is invalid")
)

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(signingKey string) (*Manager, error)

func (*Manager) CreateJWT

func (m *Manager) CreateJWT(userId string, ttl time.Duration) (string, error)

func (*Manager) ValidateToken

func (m *Manager) ValidateToken(accessToken string) (string, error)

type TokenManager

type TokenManager interface {
	CreateJWT(userid string, ttl time.Duration) (string, error)
	ValidateToken(refreshToken string) (string, error)
}

Jump to

Keyboard shortcuts

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