handlers

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDataException = &gqlerror.Error{
		Message: "data error",
		Extensions: map[string]interface{}{
			"code": "data_exception",
		},
	}
	ErrInternal = &gqlerror.Error{
		Message: "internal error server",
		Extensions: map[string]interface{}{
			"code": "internal",
		},
	}
	ErrTooManyRequests = &gqlerror.Error{
		Message: "too many requests",
		Extensions: map[string]interface{}{
			"code": "too_many_requests",
		},
	}
	ErrIncorrectUsernameOrPassword = &gqlerror.Error{
		Message: "incorrect username or password",
		Extensions: map[string]interface{}{
			"code": "incorrect_username_or_password",
		},
	}
	ErrEmailNotConfirmed = &gqlerror.Error{
		Message: "email not confirmed",
		Extensions: map[string]interface{}{
			"code": "email_not_confirmed",
		},
	}
	ErrPhoneNotConfirmed = &gqlerror.Error{
		Message: "phone not confirmed",
		Extensions: map[string]interface{}{
			"code": "phone_not_confirmed",
		},
	}
	ErrWebHook = &gqlerror.Error{
		Message: "webhook error",
		Extensions: map[string]interface{}{
			"code": "webhook_error",
		},
	}
	ErrRefreshTokenNotFound = &gqlerror.Error{
		Message: "refresh token not found",
		Extensions: map[string]interface{}{
			"code": "refresh_token_not_found",
		},
	}
	ErrInvalidEmail = &gqlerror.Error{
		Message: "invalid email address",
		Extensions: map[string]interface{}{
			"code": "invalid_email_address",
		},
	}
	ErrInvalidPhone = &gqlerror.Error{
		Message: "invalid phone number",
		Extensions: map[string]interface{}{
			"code": "invalid_phone_number",
		},
	}
	ErrInvalidPassword = &gqlerror.Error{
		Message: "invalid password",
		Extensions: map[string]interface{}{
			"code": "invalid_password",
		},
	}
	ErrEmailDisabled = &gqlerror.Error{
		Message: "email disabled",
		Extensions: map[string]interface{}{
			"code": "email_disabled",
		},
	}
	ErrPhoneDisabled = &gqlerror.Error{
		Message: "phone disabled",
		Extensions: map[string]interface{}{
			"code": "phone_disabled",
		},
	}
	ErrEmailRegistered = &gqlerror.Error{
		Message: "email address registered",
		Extensions: map[string]interface{}{
			"code": "email_address_registered",
		},
	}
	ErrPhoneRegistered = &gqlerror.Error{
		Message: "phone number registered",
		Extensions: map[string]interface{}{
			"code": "phone_number_registered",
		},
	}
	ErrRecoveryTokenNotFound = &gqlerror.Error{
		Message: "recovery token not found",
		Extensions: map[string]interface{}{
			"code": "recovery_token_not_found",
		},
	}
	ErrInvalidJWT = &gqlerror.Error{
		Message: "invalid json web token",
		Extensions: map[string]interface{}{
			"code": "invalid_jwt",
		},
	}
	ErrUserNotFound = &gqlerror.Error{
		Message: "user not found",
		Extensions: map[string]interface{}{
			"code": "user_not_found",
		},
	}
	ErrNewPhoneSimilar = &gqlerror.Error{
		Message: "new phone must be different from old phone",
		Extensions: map[string]interface{}{
			"code": "new_phone_equals_old",
		},
	}
	ErrNewEmailSimilar = &gqlerror.Error{
		Message: "new email must be different from old email",
		Extensions: map[string]interface{}{
			"code": "new_email_equals_old",
		},
	}
	ErrCantChangePhoneNow = &gqlerror.Error{
		Message: "cant change phone right now",
		Extensions: map[string]interface{}{
			"code": "cant_change_phone",
		},
	}
	ErrCantChangeEmailNow = &gqlerror.Error{
		Message: "cant change email right now",
		Extensions: map[string]interface{}{
			"code": "cant_change_email",
		},
	}
	ErrIncorrectOldPassword = &gqlerror.Error{
		Message: "incorrect old password",
		Extensions: map[string]interface{}{
			"code": "incorrect_old_password",
		},
	}
	ErrAdminOnly = &gqlerror.Error{
		Message: "only an admin can perform this action",
		Extensions: map[string]interface{}{
			"code": "admin_only",
		},
	}
	ErrEmailOrPhoneRequired = &gqlerror.Error{
		Message: "email or phone required",
		Extensions: map[string]interface{}{
			"code": "email_or_phone_required",
		},
	}
	ErrCantChangeOwnAccount = &gqlerror.Error{
		Message: "can't change your own account",
		Extensions: map[string]interface{}{
			"code": "cant_change_own_account",
		},
	}
	ErrAccountLocked = &gqlerror.Error{
		Message: "account has been locked",
		Extensions: map[string]interface{}{
			"code": "account_locked",
		},
	}
	ErrObjectDoesntMatchSchema = &gqlerror.Error{
		Message: "custom data doesn't match custom data schema",
		Extensions: map[string]interface{}{
			"code": "custom_data_doesnt_match_schema",
		},
	}
)

Functions

func SendEmailConfirmation added in v0.8.0

func SendEmailConfirmation(user *model.User, tx *gorm.DB, config *config.Config) error

func SendPhoneConfirmation added in v0.8.0

func SendPhoneConfirmation(user *model.User, tx *gorm.DB, config *config.Config) error

func SignIn added in v0.8.0

func SignIn(user *model.User, ip, ua string, tx *gorm.DB, res http.ResponseWriter) (string, string, error)

func ValidateEmail added in v0.8.0

func ValidateEmail(email string, tx *gorm.DB, config *config.Config) error

func ValidatePhone added in v0.8.0

func ValidatePhone(phone string, tx *gorm.DB, config *config.Config) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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