Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthErrorInvalidToken CommandErrorCode = 20301 AuthErrorFailedToRetrieveAccount CommandErrorCode = 20302 AuthErrorAccountDoesNotExist CommandErrorCode = 20303 AuthErrorOtpExists CommandErrorCode = 20304 )
View Source
const ( CompleteRegistrationErrorAlreadyRegistered CommandErrorCode = 20201 CompleteRegistrationErrorUpdateFailure CommandErrorCode = 20202 CompleteRegistrationErrorAccountIsNotRegistered CommandErrorCode = 20203 CompleteRegistrationErrorFailedToGetAccount CommandErrorCode = 20203 CompleteRegistrationErrorInvalidInput CommandErrorCode = 20204 CompleteRegistrationErrorPasswordMismatch CommandErrorCode = 20205 )
View Source
const ( GenerateOtpErrorInvalidEmail CommandErrorCode = 20001 GenerateOtpErrorFailedToGenOtp CommandErrorCode = 20002 GenerateOtpErrorFailedToStoreOtp CommandErrorCode = 20003 GenerateOtpErrorOtpExists CommandErrorCode = 20004 )
View Source
const ( GrantAdminRoleErrorFailedToVerifyAccount CommandErrorCode = 20501 GrantAdminRoleErrorFailedToUpdateAccount CommandErrorCode = 20502 )
View Source
const ( ResetPasswordErrorInvalidInput CommandErrorCode = 20401 ResetPasswordErrorFailedToVerifyAccount CommandErrorCode = 20402 )
View Source
const ( SavePasswordErrorInvalidInput CommandErrorCode = 20401 SavePasswordErrorFailedToVerifyAccount CommandErrorCode = 20402 )
View Source
const ( SigninMethodPassword SigninMethod = "password" SigninMethodOTP SigninMethod = "otp" SigninErrorFailedToGetOtp CommandErrorCode = 20101 SigninErrorOtpExired CommandErrorCode = 20102 SigninErrorWrongOtp CommandErrorCode = 20103 SigninErrorFailedToCreateToken CommandErrorCode = 20104 SigninErrorOTPNotFound CommandErrorCode = 20105 SigninErrorOTPFailedToInvalidateOTP CommandErrorCode = 20106 SignInErrorPasswordFailedToGetAccountDetail CommandErrorCode = 20107 SignInErrorFailedToCreateNewAccount CommandErrorCode = 20108 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthCommand ¶
func (AuthCommand) Execute ¶
func (cmd AuthCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.AuthData]
type CommandContext ¶
type CommandContext interface { AccountRepository() repositories.AccountRepository OtpRepository() repositories.OtpRepository PasswordRepository() repositories.PasswordRepository }
type CompleteRegistrationCommand ¶
type CompleteRegistrationCommand struct {
Input dto.CompleteRegistrationInput
}
func (CompleteRegistrationCommand) Execute ¶
func (cmd CompleteRegistrationCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.AuthData]
type GenerateOtpCommand ¶
func (GenerateOtpCommand) Execute ¶
func (cmd GenerateOtpCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.OtpResult]
type GenerateResetTokenCommand ¶
func (GenerateResetTokenCommand) Execute ¶
func (cmd GenerateResetTokenCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.PasswordResetCodeResult]
type GrantAdminRoleCommand ¶
type GrantAdminRoleCommand struct {
Email string
}
A hacky command to grant admin role to user TODO refactor
func (GrantAdminRoleCommand) Execute ¶
func (cmd GrantAdminRoleCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.AuthData]
type ResetPasswordCommand ¶
type ResetPasswordCommand struct {
Input dto.PasswordResetInput
}
func (ResetPasswordCommand) Execute ¶
func (cmd ResetPasswordCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.PasswordResult]
type SavePasswordCommand ¶
type SavePasswordCommand struct { Email entities.EmailAddress Password []byte }
func (SavePasswordCommand) Execute ¶
func (cmd SavePasswordCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.PasswordResult]
type SigninCommand ¶
func (SigninCommand) Execute ¶
func (cmd SigninCommand) Execute(ctx CommandContext) CommandExecutionResult[dto.SignInResult]
type SigninMethod ¶
type SigninMethod string
Click to show internal directories.
Click to hide internal directories.