Documentation
¶
Index ¶
- Variables
- type AuthCode
- type Config
- type Mode
- type Params
- type Service
- func (s *Service) AuthorizeDevice(token string) (models.Device, error)
- func (s *Service) AuthorizeRegistration(token string) error
- func (s *Service) AuthorizeUser(username, password string) (models.User, error)
- func (s *Service) AuthorizeUserByCode(code string) (models.User, error)
- func (s *Service) ChangePassword(userID string, currentPassword string, newPassword string) error
- func (s *Service) GenerateUserCode(userID string) (AuthCode, error)
- func (s *Service) IsPublic() bool
- func (s *Service) RegisterDevice(user models.User, name, pushToken *string) (models.Device, error)
- func (s *Service) RegisterUser(login, password string) (models.User, error)
- func (s *Service) Run(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = fx.Module( "auth", fx.Decorate(func(log *zap.Logger) *zap.Logger { return log.Named("auth") }), fx.Provide(New), fx.Provide(newRepository, fx.Private), fx.Invoke(func(lc fx.Lifecycle, svc *Service) { ctx, cancel := context.WithCancel(context.Background()) lc.Append(fx.Hook{ OnStart: func(_ context.Context) error { go svc.Run(ctx) return nil }, OnStop: func(_ context.Context) error { cancel() return nil }, }) }), )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AuthorizeDevice ¶
func (*Service) AuthorizeRegistration ¶
func (*Service) AuthorizeUser ¶
func (*Service) AuthorizeUserByCode ¶ added in v1.19.0
AuthorizeUserByCode authorizes a user by one-time code.
func (*Service) ChangePassword ¶ added in v1.16.0
func (*Service) GenerateUserCode ¶ added in v1.19.0
GenerateUserCode generates a unique one-time user authorization code
func (*Service) RegisterDevice ¶
func (*Service) RegisterUser ¶
Click to show internal directories.
Click to hide internal directories.