auth

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput = errors.New("invalid input")
	ErrUnauthorized = errors.New("unauthorized")
	ErrTokenExpired = errors.New("token expired")
)

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(users *user.Service, devices *device.Service, invites *serverinvite.Service) *Service

func (*Service) Login

func (s *Service) Login(ctx context.Context, username, password, publicKey string) (user.User, device.Device, Session, error)

func (*Service) Register

func (s *Service) Register(ctx context.Context, username, password, publicKey, inviteToken string) (user.User, device.Device, Session, error)

func (*Service) ValidateToken

func (s *Service) ValidateToken(token string) (Session, error)

type Session

type Session struct {
	Token     string
	UserID    user.ID
	DeviceID  device.ID
	Username  string
	ExpiresAt time.Time
}

Jump to

Keyboard shortcuts

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