jsonwebtoken

package
v0.0.0-...-2a11bd6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package jsonwebtoken contains logic for using JSON web tokens

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(secret, algo string, d int) *Service

New generates new JWT service necessery for auth middleware

func (*Service) GenerateToken

func (j *Service) GenerateToken(u *models.User) (string, string, error)

GenerateToken generates new JWT token and populates it with user data

func (*Service) MWFunc

func (j *Service) MWFunc() echo.MiddlewareFunc

MWFunc makes JWT implement the Middleware interface.

func (*Service) ParseToken

func (j *Service) ParseToken(c echo.Context) (*jwtGo.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