Documentation
¶
Index ¶
- type Service
- func (s *Service) ChangePassword(ctx context.Context, userUuid uuid.UUID, newPassword string) error
- func (s *Service) CheckIsAdmin(ctx context.Context, userUuid uuid.UUID) error
- func (s *Service) CreateUserUnchecked(ctx context.Context, email, password string) (domain.User, error)
- func (s *Service) EnsureNoAuthUser(ctx context.Context) (domain.User, error)
- func (s *Service) GetMe(ctx context.Context, userUuid uuid.UUID) (domain.UserDetails, error)
- func (s *Service) Login(ctx context.Context, email, password string) (domain.Session, error)
- func (s *Service) LoginOrRegisterAdminViaTelegram(ctx context.Context, idToken string) (domain.Session, error)
- func (s *Service) LoginViaTelegram(ctx context.Context, idToken string) (domain.Session, error)
- func (s *Service) Logout(ctx context.Context, token string) error
- func (s *Service) Refresh(ctx context.Context, refreshToken string) (domain.Session, error)
- func (s *Service) Register(ctx context.Context, email, password string) (domain.User, error)
- func (s *Service) RegisterAdmin(ctx context.Context, email, password string) (domain.User, error)
- func (s *Service) ValidateToken(ctx context.Context, token string) (domain.User, error)
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
}
func New ¶
func New(repo repository.Repo, telegramClientId string, subscriptions service.SubscriptionService) *Service
func (*Service) ChangePassword ¶
ChangePassword overwrites userUuid's password hash — used by the admin users page to reset a user's password. Callers are responsible for authorizing the caller before invoking this.
func (*Service) CheckIsAdmin ¶
func (*Service) CreateUserUnchecked ¶
func (s *Service) CreateUserUnchecked(ctx context.Context, email, password string) (domain.User, error)
CreateUserUnchecked creates a new non-admin account, bypassing all setup/registration-mode/ auth-method checks — used only by the admin users page, where the caller is already authenticated and authorized as an administrator at the transport level.
func (*Service) EnsureNoAuthUser ¶
func (*Service) LoginOrRegisterAdminViaTelegram ¶
func (s *Service) LoginOrRegisterAdminViaTelegram(ctx context.Context, idToken string) (domain.Session, error)
LoginOrRegisterAdminViaTelegram is the wizard-only variant of LoginViaTelegram: it bypasses all setup/auth-method checks and promotes the resulting user to administrator, whether they were just created or already existed.
func (*Service) LoginViaTelegram ¶
func (*Service) RegisterAdmin ¶
RegisterAdmin creates a new administrator account, bypassing all setup/registration-mode/ auth-method checks — used only by the first-run setup wizard, which runs before setup is marked complete.