Documentation
¶
Index ¶
- type PasetoTokenizer
- func (pt *PasetoTokenizer) DecryptToken(ctx context.Context, token string) (core.TokenPayload, error)
- func (pt *PasetoTokenizer) GenerateAccessToken(ctx context.Context, params core.GenerateTokenParam) (string, error)
- func (pt *PasetoTokenizer) GenerateRefreshToken(ctx context.Context, params core.GenerateTokenParam) (string, error)
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
Click to show internal directories.
Click to hide internal directories.