token

package
v0.0.0-...-5e83000 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: BSD-2-Clause-Patent Imports: 5 Imported by: 0

Documentation

Overview

Package token contains token generation implementations.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptySecret = errors.New("empty secret")
)

Errors.

Functions

This section is empty.

Types

type JWT

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

JWT is used to generate jwt tokens.

func NewJWT

func NewJWT(issuer, secret string, authTokenExp, refreshTokenExp time.Duration) (*JWT, error)

NewJWT creates new jwt.

func (*JWT) JWTAuth

func (j *JWT) JWTAuth() *jwtauth.JWTAuth

JWTAuth returns jwt auth.

func (*JWT) Tokens

func (j *JWT) Tokens(userID, requestID string) (authToken, refreshToken string, err error)

Tokens generates auth and refresh jwt tokens.

Jump to

Keyboard shortcuts

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