Documentation
¶
Index ¶
- func NewApi(useCases UseCases, authService *Service) models.AuthApi
- type AuthApiImpl
- func (a *AuthApiImpl) ChangePassword(ctx context.Context, rawToken string, newPassword string) error
- func (a *AuthApiImpl) EmailChange(ctx context.Context, userID string, newEmail string, callbackURL *string) error
- func (a *AuthApiImpl) GetMe(ctx context.Context, userID string) (*models.MeResult, error)
- func (a *AuthApiImpl) PrepareOAuth2Login(ctx context.Context, providerName string) (*models.OAuth2LoginResult, error)
- func (a *AuthApiImpl) ResetPassword(ctx context.Context, email string, callbackURL *string) error
- func (a *AuthApiImpl) SendEmailVerification(ctx context.Context, userID string, callbackURL *string) error
- func (a *AuthApiImpl) Services() *models.AuthServices
- func (a *AuthApiImpl) SignInWithEmailAndPassword(ctx context.Context, email string, password string, callbackURL *string) (*models.SignInResult, error)
- func (a *AuthApiImpl) SignInWithOAuth2(ctx context.Context, providerName string, code string, state string, ...) (*models.SignInResult, error)
- func (a *AuthApiImpl) SignOut(ctx context.Context, sessionToken string) error
- func (a *AuthApiImpl) SignUpWithEmailAndPassword(ctx context.Context, name string, email string, password string, ...) (*models.SignUpResult, error)
- func (a *AuthApiImpl) VerifyEmail(ctx context.Context, rawToken string) (*models.VerifyEmailResult, error)
- type Service
- type UseCases
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthApiImpl ¶ added in v1.4.0
type AuthApiImpl struct {
// contains filtered or unexported fields
}
func (*AuthApiImpl) ChangePassword ¶ added in v1.4.0
func (*AuthApiImpl) EmailChange ¶ added in v1.4.0
func (*AuthApiImpl) PrepareOAuth2Login ¶ added in v1.4.0
func (a *AuthApiImpl) PrepareOAuth2Login(ctx context.Context, providerName string) (*models.OAuth2LoginResult, error)
func (*AuthApiImpl) ResetPassword ¶ added in v1.4.0
func (*AuthApiImpl) SendEmailVerification ¶ added in v1.4.0
func (*AuthApiImpl) Services ¶ added in v1.4.0
func (a *AuthApiImpl) Services() *models.AuthServices
func (*AuthApiImpl) SignInWithEmailAndPassword ¶ added in v1.4.0
func (a *AuthApiImpl) SignInWithEmailAndPassword(ctx context.Context, email string, password string, callbackURL *string) (*models.SignInResult, error)
func (*AuthApiImpl) SignInWithOAuth2 ¶ added in v1.4.0
func (a *AuthApiImpl) SignInWithOAuth2(ctx context.Context, providerName string, code string, state string, verifier *string) (*models.SignInResult, error)
func (*AuthApiImpl) SignOut ¶ added in v1.4.0
func (a *AuthApiImpl) SignOut(ctx context.Context, sessionToken string) error
func (*AuthApiImpl) SignUpWithEmailAndPassword ¶ added in v1.4.0
func (a *AuthApiImpl) SignUpWithEmailAndPassword(ctx context.Context, name string, email string, password string, callbackURL *string) (*models.SignUpResult, error)
func (*AuthApiImpl) VerifyEmail ¶ added in v1.4.0
func (a *AuthApiImpl) VerifyEmail(ctx context.Context, rawToken string) (*models.VerifyEmailResult, error)
type Service ¶
type Service struct {
EventBus models.EventBus
WebhookExecutor models.WebhookExecutor
EventEmitter models.EventEmitter
UserService models.UserService
AccountService models.AccountService
SessionService models.SessionService
VerificationService models.VerificationService
PasswordService models.PasswordService
TokenService models.TokenService
RateLimitService models.RateLimitService
MailerService models.MailerService
OAuth2ProviderRegistry *oauth2providers.OAuth2ProviderRegistry
// contains filtered or unexported fields
}
Service encapsulates all services
func NewService ¶
func NewService( config *models.Config, eventBus models.EventBus, webhookExecutor models.WebhookExecutor, eventEmitter models.EventEmitter, userService models.UserService, accountService models.AccountService, sessionService models.SessionService, verificationService models.VerificationService, passwordService models.PasswordService, tokenService models.TokenService, rateLimitService models.RateLimitService, mailerService models.MailerService, oauth2ProviderRegistry *oauth2providers.OAuth2ProviderRegistry, ) *Service
NewService creates a new Auth service with all dependencies
type UseCases ¶ added in v1.4.0
type UseCases struct {
SignUpUseCase signup.SignUpUseCase
SignInUseCase signin.SignInUseCase
SignOutUseCase signout.SignOutUseCase
VerifyEmailUseCase verifyemail.VerifyEmailUseCase
SendEmailVerificationUseCase sendemailverification.SendEmailVerificationUseCase
ResetPasswordUseCase resetpassword.ResetPasswordUseCase
ChangePasswordUseCase changepassword.ChangePasswordUseCase
EmailChangeUseCase emailchange.EmailChangeUseCase
MeUseCase me.MeUseCase
OAuth2UseCase oauth2.OAuth2UseCase
}
Click to show internal directories.
Click to hide internal directories.