usecases

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangePasswordUseCase

type ChangePasswordUseCase interface {
	ChangePassword(ctx context.Context, tokenValue string, newPassword string) error
}

func NewChangePasswordUseCase added in v1.2.0

func NewChangePasswordUseCase(
	logger models.Logger,
	pluginConfig types.EmailPasswordPluginConfig,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	verificationService rootservices.VerificationService,
	tokenService rootservices.TokenService,
	passwordService rootservices.PasswordService,
	mailerService rootservices.MailerService,
	eventBus models.EventBus,
) ChangePasswordUseCase

type RequestEmailChangeUseCase

type RequestEmailChangeUseCase interface {
	RequestChange(ctx context.Context, userID string, newEmail string, callbackURL *string) error
}

func NewRequestEmailChangeUseCase added in v1.2.0

func NewRequestEmailChangeUseCase(
	logger models.Logger,
	globalConfig *models.Config,
	pluginConfig types.EmailPasswordPluginConfig,
	userService rootservices.UserService,
	verificationService rootservices.VerificationService,
	tokenService rootservices.TokenService,
	mailerService rootservices.MailerService,
) RequestEmailChangeUseCase

type RequestPasswordResetUseCase

type RequestPasswordResetUseCase interface {
	RequestReset(ctx context.Context, email string, callbackURL *string) error
}

func NewRequestPasswordResetUseCase added in v1.2.0

func NewRequestPasswordResetUseCase(
	logger models.Logger,
	globalConfig *models.Config,
	pluginConfig types.EmailPasswordPluginConfig,
	userService rootservices.UserService,
	verificationService rootservices.VerificationService,
	tokenService rootservices.TokenService,
	mailerService rootservices.MailerService,
) RequestPasswordResetUseCase

type SendEmailVerificationUseCase

type SendEmailVerificationUseCase interface {
	Send(ctx context.Context, userID string, callbackURL *string) error
}

func NewSendEmailVerificationUseCase added in v1.2.0

func NewSendEmailVerificationUseCase(
	globalConfig *models.Config,
	pluginConfig types.EmailPasswordPluginConfig,
	logger models.Logger,
	userService rootservices.UserService,
	verificationService rootservices.VerificationService,
	tokenService rootservices.TokenService,
	mailerService rootservices.MailerService,
) SendEmailVerificationUseCase

type SignInUseCase

type SignInUseCase interface {
	SignIn(ctx context.Context, email string, password string, callbackURL *string, ipAddress *string, userAgent *string) (*types.SignInResult, error)
	GetSessionByID(ctx context.Context, sessionID string) (*models.Session, error)
	GetUserByID(ctx context.Context, userID string) (*models.User, error)
}

func NewSignInUseCase added in v1.2.0

func NewSignInUseCase(
	globalConfig *models.Config,
	pluginConfig types.EmailPasswordPluginConfig,
	logger models.Logger,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	sessionService rootservices.SessionService,
	tokenService rootservices.TokenService,
	passwordService rootservices.PasswordService,
	eventBus models.EventBus,
) SignInUseCase

type SignUpUseCase

type SignUpUseCase interface {
	SignUp(ctx context.Context, name string, email string, password string, image *string, metadata json.RawMessage, callbackURL *string, ipAddress *string, userAgent *string) (*types.SignUpResult, error)
}

func NewSignUpUseCase added in v1.2.0

func NewSignUpUseCase(
	globalConfig *models.Config,
	pluginConfig types.EmailPasswordPluginConfig,
	logger models.Logger,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	sessionService rootservices.SessionService,
	tokenService rootservices.TokenService,
	passwordService rootservices.PasswordService,
	eventBus models.EventBus,
) SignUpUseCase

type UseCases

type UseCases struct {
	SignUpUseCase                SignUpUseCase
	SignInUseCase                SignInUseCase
	VerifyEmailUseCase           VerifyEmailUseCase
	SendEmailVerificationUseCase SendEmailVerificationUseCase
	RequestPasswordResetUseCase  RequestPasswordResetUseCase
	ChangePasswordUseCase        ChangePasswordUseCase
	RequestEmailChangeUseCase    RequestEmailChangeUseCase
}

type VerifyEmailUseCase

type VerifyEmailUseCase interface {
	VerifyEmail(ctx context.Context, tokenStr string) (models.VerificationType, error)
}

func NewVerifyEmailUseCase added in v1.2.0

func NewVerifyEmailUseCase(
	pluginConfig types.EmailPasswordPluginConfig,
	logger models.Logger,
	userService rootservices.UserService,
	accountService rootservices.AccountService,
	verificationService rootservices.VerificationService,
	tokenService rootservices.TokenService,
	mailerService rootservices.MailerService,
	eventBus models.EventBus,
) VerifyEmailUseCase

Jump to

Keyboard shortcuts

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