Documentation ¶
Index ¶
- Constants
- Variables
- type Auth
- type Token
- func (svc *Token) CreateResetPasswordToken(ctx context.Context, userID uuid.UUID) (string, error)
- func (svc *Token) CreateSubscriberEmailValidation(ctx context.Context, subscriberID uuid.UUID) (string, error)
- func (svc *Token) CreateUnsubscribeToken(ctx context.Context, subscriberID uuid.UUID) (string, error)
- func (svc *Token) CreateUserEmailVerification(ctx context.Context, userID uuid.UUID) (string, error)
- func (svc *Token) Delete(ctx context.Context, token string) error
- func (svc *Token) GetAssociatedSubscriberID(ctx context.Context, token string) (uuid.UUID, error)
- func (svc *Token) GetAssociatedUserID(ctx context.Context, token string) (uuid.UUID, error)
- func (svc *Token) IsExpired(ctx context.Context, token string) error
- func (svc *Token) Validate(ctx context.Context, token, scope string) error
- type TokenMetaInformation
Constants ¶
View Source
const ( ScopeEmailVerification = "email_verification" ScopeUnsubscribe = "unsubscribe" ScopeResetPassword = "password_reset" )
Variables ¶
View Source
var ( ErrInvalidInput = errors.New("one or more of the provided inputs are not valid") ErrEmailNotValidated = errors.New("user email not validated") ErrUserNotExist = errors.New("user have not been registered") ErrPasswordNotMatch = errors.New("provided password does not match our records") ErrPasswordMatchConfirm = errors.New("provided password does not match confirm password") ErrPasswordLength = errors.New("provided password has insufficient length") ErrTokenNotExist = errors.New("the provided token does not exist") ErrTokenExpired = errors.New("token expired") ErrTokenScopeInvalid = errors.New("the scope of the token was not what was expected") ErrUnrecoverable = errors.New("an unexpected error has occurred") )
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func NewAuth ¶
func NewAuth( db psql.Postgres, email emailClient.EmailClient, ) Auth
func (Auth) AuthenticateUser ¶
func (Auth) RegisterUser ¶
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func (*Token) CreateResetPasswordToken ¶
func (*Token) CreateSubscriberEmailValidation ¶
func (*Token) CreateUnsubscribeToken ¶
func (*Token) CreateUserEmailVerification ¶
func (*Token) GetAssociatedSubscriberID ¶
func (*Token) GetAssociatedUserID ¶
Click to show internal directories.
Click to hide internal directories.