token

package
v1.0.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PasetoTokenizer

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

func NewPaseto

func NewPaseto(secretKey string, atd, rtd time.Duration) (*PasetoTokenizer, error)

NewPaseto Creates a new instance of PasetoTokenizer

func (*PasetoTokenizer) DecryptToken

func (pt *PasetoTokenizer) DecryptToken(ctx context.Context, token string) (core.TokenPayload, error)

DecryptToken decrypts the token to get `TokenPayload` & verifies that token hasn't expired

func (*PasetoTokenizer) GenerateAccessToken

func (pt *PasetoTokenizer) GenerateAccessToken(ctx context.Context, params core.GenerateTokenParam) (string, error)

GenerateAccessToken Creates a new access token

func (*PasetoTokenizer) GenerateRefreshToken

func (pt *PasetoTokenizer) GenerateRefreshToken(ctx context.Context, params core.GenerateTokenParam) (string, error)

GenerateRefreshToken Creates a new refresh token

Jump to

Keyboard shortcuts

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