Documentation
¶
Index ¶
- Variables
- type EmailSignInInput
- type EmailSignUpInput
- type Resolver
- func (r *Resolver) ChangePassword(ctx context.Context, input action.ChangePasswordInput) error
- func (r *Resolver) ConfirmResetPassword(ctx context.Context, input action.ConfirmResetPasswordInput) (string, error)
- func (r *Resolver) EmailSignIn(ctx context.Context, input EmailSignInInput) (graphql.TokenPair, error)
- func (r *Resolver) EmailSignUp(ctx context.Context, input EmailSignUpInput) (graphql.TokenPair, error)
- func (r *Resolver) RequestResetPassword(ctx context.Context, email string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongCredentials = erruser.New("wrong credentials", "Email or password is wrong")
Functions ¶
This section is empty.
Types ¶
type EmailSignInInput ¶
type EmailSignInInput struct {
Email string `json:"email"`
Password string `json:"password"`
Captcha *captchaAction.CaptchaToken `json:"captcha"`
}
type EmailSignUpInput ¶
type EmailSignUpInput struct {
Email string `json:"email"`
Password string `json:"password"`
Captcha *captchaAction.CaptchaToken `json:"captcha"`
// The unique identifier of the user.
// It will be used as the ID in the account table.
// If empty, it will be generated automatically.
ID uuid.UUID `json:"-"`
// Additional user fields that may be stored in the account table.
// It has to be set in the wrapper resolver instead of the GraphQL query if needed.
UserInfo map[string]interface{} `json:"-"`
// A set of roles that will be assigned to the user during registration.
// It has to be set in the wrapper resolver instead of the GraphQL query if needed.
// By default, the user will be assigned the role "user".
Roles []string `json:"-"`
}
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func NewResolver ¶
func NewResolver( register *action.Register, login *action.Login, resetPassword *action.ResetPassword, changePassword *action.ChangePassword, checkCaptcha *captchaAction.CheckCaptcha, ) *Resolver
func (*Resolver) ChangePassword ¶
func (*Resolver) ConfirmResetPassword ¶
func (*Resolver) EmailSignIn ¶
func (*Resolver) EmailSignUp ¶
func (r *Resolver) EmailSignUp(ctx context.Context, input EmailSignUpInput) (graphql.TokenPair, error)
EmailSignUp registers a new user via email and password. Errors: * github.com/go-modulus/auth/providers/email/action.ErrEmailAlreadyExists - the identity with such email already exists. * github.com/go-modulus/auth/providers/email/action.ErrUserAlreadyExists - overridden user provider says that the user already exists. * github.com/go-modulus/auth/providers/email/action.ErrCannotLogin - cannot log in automatically after registration.
Click to show internal directories.
Click to hide internal directories.