Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAuth ¶
func NewAuth(cfg AuthConfig, store store, mailer mailer.Mailer) authImpl
func NewStorePg ¶
func NewStoreSqlite ¶
Types ¶
type Auth ¶
type Auth interface {
Signup(email, password, lang string) (confirmationTokenStr string, err error)
ResendConfirmationMail(email, lang string) (confirmationTokenStr string, err error)
ConfirmSignup(confirmationTokenStr string) error
Signin(email, password string) (sessionTokenStr string, err error)
ForgotPasword(email, lang string) (resetTokenStr string, err error)
ResetPassword(resetTokenStr, newPassword string) error
ChangePassword(sessionTokenStr, oldPassword, newPassword string) error
ChangeEmail(sessionTokenStr, password, newEmail string) error
GetUsers(adminKey string) ([]User, error)
CreateUser(adminKey, email, password, lang string) error
ChangeUserPassword(adminKey, userId, newPassword string) error
ChangeUserEmail(adminKey, userId, newEmail string) error
RemoveUsers(adminKey string, userIds ...string) error
RemoveUnconfirmedUsers(adminKey string) error
}
type AuthConfig ¶
type AuthConfig struct {
AdminKey string
JwtKey string
MaxUnconfirmedUsersAge string
MaxResetKeyAge string
FromEmail string
ConfirmationEmail AuthMailConfig
ResetPasswordEmail AuthMailConfig
}
type AuthMailConfig ¶
Click to show internal directories.
Click to hide internal directories.