jwt

package
v0.0.0-...-a7cfde9 Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service provides a Json-Web-Token authentication implementation

func New

func New(algo, secret string, ttlMinutes, minSecretLength int) (Service, error)

New generates new JWT service necessary for auth middleware

func (Service) GenerateToken

func (s Service) GenerateToken(u lilcoders.User) (string, error)

GenerateToken generates new JWT token and populates it with user data

func (Service) ParseToken

func (s Service) ParseToken(authHeader string) (*jwt.Token, error)

ParseToken parses token from Authorization header

Jump to

Keyboard shortcuts

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