auth

package
v0.0.0-...-c9bcc77 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidEmail = errors.New("err.auth.invalid_email")
View Source
var ErrInvalidSession = errors.New("err.auth.invalid_session")
View Source
var ErrInvalidToken = errors.New("err.auth.invalid_token")
View Source
var ErrTokenExpired = errors.New("err.auth.token_expired")
View Source
var ErrTokenNotFound = errors.New("err.auth.token_not_found")
View Source
var ErrTokenReplay = errors.New("err.auth.token_replay")
View Source
var ErrTokenUserMismatch = errors.New("err.auth.token_user_mismatch")
View Source
var ErrUserAgentMismatch = errors.New("err.auth.user_agent_mismatch")
View Source
var ErrUserDisabled = errors.New("err.auth.user_disabled")

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(store data.Store, sender email.Sender, config *config.Config) *Service

func (*Service) CreateSession

func (s *Service) CreateSession(ctx context.Context, userID uuid.UUID) (*data.Session, error)

func (*Service) EmailSignIn

func (s *Service) EmailSignIn(ctx context.Context, email string) (*data.User, error)

func (*Service) Logout

func (s *Service) Logout(ctx context.Context, sessionID string) error

func (*Service) Token

func (s *Service) Token(ctx context.Context, tokenHash string) (*data.UserAuthToken, error)

func (*Service) UseToken

func (s *Service) UseToken(ctx context.Context, token string, usedAt time.Time) (*data.User, error)

func (*Service) ValidateSession

func (s *Service) ValidateSession(ctx context.Context, sessionID string) (*data.User, error)

Jump to

Keyboard shortcuts

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