Documentation
¶
Index ¶
- Constants
- Variables
- type AuthService
- func (a *AuthService) Authenticate(ctx context.Context, accessToken string) (*model.User, *vali.Varror)
- func (a *AuthService) ChangePassword(ctx context.Context, userID model.UserID, oldPassword string, ...) *vali.Varror
- func (s *AuthService) DeleteAccount(ctx context.Context, userID model.UserID, password string) *vali.Varror
- func (a *AuthService) Login(ctx context.Context, email string, password string) (_ *model.User, act string, rft string, varror *vali.Varror)
- func (a *AuthService) RefreshToken(ctx context.Context, userID model.UserID, refreshToken string) (string, *vali.Varror)
- func (a *AuthService) Register(ctx context.Context, name string, lastName string, username string, ...) (verifyEmailToken string, varror *vali.Varror)
- func (a *AuthService) SendResetPassword(ctx context.Context, email string, resetPasswordRedirectUrl string) (token string, timeout time.Duration, varror *vali.Varror)
- func (a *AuthService) SubmitResetPassword(ctx context.Context, token string, newPassword string) *vali.Varror
- func (a *AuthService) VerifyEmail(ctx context.Context, verifyEmailToken string) *vali.Varror
- type DetailedValidation
Constants ¶
Variables ¶
View Source
var ( ErrInvalidValidation = errors.New("invalid validation") ErrAccessDenied = errors.New("access denied") ErrEmailNotVerified = errors.New("email not verified") ErrAccountLocked = errors.New("account locked") )
General errors
View Source
var ( ErrNotFound = errors.New("user not found") ErrInvalidEmailOrPassword = errors.New("invalid email or password") ErrEmailAlreadyExist = errors.New("email already exists") ErrUsernameAlreadyExist = errors.New("username already exists") )
User errors
View Source
var ( ErrGenerateToken = errors.New("failed to generate token") ErrHashingPassword = errors.New("failed to hash password") ErrCreateAuthStore = errors.New("failed to create auth store") ErrCreateUser = errors.New("failed to create user") ErrCreateEmailToken = errors.New("failed to create email token") ErrDestroyToken = errors.New("failed to destroy token") ErrVerifyEmail = errors.New("failed to verify email") )
Authentication errors
View Source
var ( ErrChangePassword = errors.New("failed to change password") ErrClearFailedLoginAttempts = errors.New("failed to clear failed login attempts") )
Password management errors
View Source
var ( ErrUnlockAccount = errors.New("failed to unlock account") ErrLockAccount = errors.New("failed to lock account") ErrDeleteUser = errors.New("failed to delete user") ErrEmailWasNotSent = errors.New("email was not sent") )
Account management errors
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService struct { AuthService auth_manager.AuthManager // contains filtered or unexported fields }
func NewAuthService ¶
func NewAuthService(authRepo repository.AuthRepository, userRepo repository.UserRepository, authManager auth_manager.AuthManager, hashManager *hash.HashManager, emailService email.EmailService) *AuthService
func (*AuthService) Authenticate ¶
func (*AuthService) ChangePassword ¶
func (*AuthService) DeleteAccount ¶
func (*AuthService) RefreshToken ¶
func (*AuthService) SendResetPassword ¶
func (*AuthService) SubmitResetPassword ¶
func (*AuthService) VerifyEmail ¶
type DetailedValidation ¶
type DetailedValidation struct { Detail []string // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.