auth

package
v0.0.0-...-51ef577 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 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 Session

type Session struct {
	UserID string `json:"userId"`
	jwt.StandardClaims
	// contains filtered or unexported fields
}

Session aggregate root.

func NewSession

func NewSession(auth auth.Token) Session

New returns a new Session.

func (*Session) Generate

func (s *Session) Generate(userId string, ttlMinutes time.Duration) (string, *apperror.AppError)

Generate creates Access Token and assign token info to Session.

func (*Session) GenerateFromToken

func (s *Session) GenerateFromToken(token string) *apperror.AppError

GenerateFromToken verify and assign token info to Session.

Jump to

Keyboard shortcuts

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