token_decoder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthableDecoder

type AuthableDecoder interface {
	Decode(token string) (*CustomClaims, error)
}

type CustomClaims

type CustomClaims struct {
	User *JWTUser
	jwt.StandardClaims
}

CustomClaims is our custom metadata, which will be hashed and sent as the second segment in our JWT

type JWTUser

type JWTUser struct {
	ID    string
	Name  string
	Email string
}

type TokenDecoder

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

func NewDecoder

func NewDecoder(key string) *TokenDecoder

func (*TokenDecoder) Decode

func (d *TokenDecoder) Decode(tokenString string) (*CustomClaims, error)

Decode a token string into a token object

Jump to

Keyboard shortcuts

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