auth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

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

AuthService represents underlying authentication implementation

func NewService

func NewService(config config.AuthConfig, jwtGen jwt.JwtGen) *AuthService

NewService creates a new authentication service with provided configuration

func (*AuthService) Authenticate

func (svc *AuthService) Authenticate(token string) (string, time.Time, error)

Authenticate decodes token and returns user id expiry time and error if any

func (*AuthService) GenerateRefreshToken

func (svc *AuthService) GenerateRefreshToken(userID string) (string, error)

GenerateRefreshToken generates a refresh token for a provided user id

func (*AuthService) GenerateToken

func (svc *AuthService) GenerateToken(userID string) (string, error)

GenerateToken generates an access token for a provided user id

Jump to

Keyboard shortcuts

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