Documentation
¶
Index ¶
Constants ¶
View Source
const IdentityTypeGoogle = "google"
Variables ¶
View Source
var ErrAccountIsBlocked = errsys.New("account is blocked", "Your account is blocked. Please contact support.")
View Source
var ErrFailedToExchangeToken = errsys.New(
"failed to exchange token",
"There is an issue to exchange Google token. Please try again later or contact support",
)
View Source
var ErrFailedToGetUserInfo = errsys.New(
"failed to get user info",
"There is an issue to get user info from Google. Please try again later",
)
View Source
var ErrInvalidIdentity = errsys.New(
"invalid identity",
"The Google registration is broken. We cannot authenticate you at the moment. Please try again later or use another type of registration.",
)
View Source
var ErrUserAlreadyExists = erruser.New(
"user already exists",
"User with such email already exists. Please log in using another type of authentication.",
)
Functions ¶
This section is empty.
Types ¶
type DefaultUserCreator ¶
type DefaultUserCreator struct {
// contains filtered or unexported fields
}
func (*DefaultUserCreator) CreateUserFromGoogle ¶
type GoogleConfig ¶
type GoogleUser ¶
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
func NewRegister( config GoogleConfig, plainTokenAuth *auth.PlainTokenAuthenticator, identityRepository repository.IdentityRepository, accountRepository repository.AccountRepository, creator UserCreator, ) *Register
type RegisterInput ¶
type UserCreator ¶
type UserCreator interface {
// CreateUserFromGoogle creates a new user with id and email.
// It returns the created user.
// Errors:
// * ErrUserAlreadyExists - if the user already exists. In a case of this error it should return the existing user.
CreateUserFromGoogle(ctx context.Context, user User) (User, error)
}
func NewDefaultUserCreator ¶
func NewDefaultUserCreator(logger *slog.Logger) UserCreator
Click to show internal directories.
Click to hide internal directories.