Documentation ¶
Index ¶
- Constants
- func DeactivateUser(email string) error
- func DeleteUser(email string) error
- func GetUser(email string) (*userModel.User, error)
- func IndexUsers(limit int64) ([]*user.User, error)
- func LoginUser(email string, password string) (*oauth.TokenSet, error)
- func NewUser(user *userModel.User) error
- func RegisterUser(username string, email string, password string) (*userModel.User, error)
- func ResetUserPassword(email string) error
Constants ¶
const SCOPE = "read:user write:user read:card write:card read:set write:set read:deck write:deck read:health read:metrics"
Variables ¶
This section is empty.
Functions ¶
func DeactivateUser ¶ added in v1.1.4
DeactivateUser Completely removes the requested user account, both from Auth0 and from MongoDB
func DeleteUser ¶ added in v1.1.4
DeleteUser Removes the requested users account from the MongoDB database. Does not remove there account from Auth0. Returns ErrUserMissingId if email is empty string, returns ErrInvalidEmail if the email address passed is not valid, returns ErrUserDeleteFailed if the DeletedCount is less than 1, and returns nil otherwise
func GetUser ¶
GetUser Fetch a user based on their username. Returns ErrNoUser if the user cannot be found
func IndexUsers ¶ added in v1.1.4
IndexUsers List all users from the database, and return them in a slice. A limit can be provided to ensure that too many objects don't get returned
func LoginUser ¶
LoginUser Log a user in with there email address and password and return back an oauth.TokenSet
func NewUser ¶
NewUser Insert the contents of a User model in the MongoDB database. Returns ErrUserMissingId if the Username, or Email is not present Returns ErrUserAlreadyExist if a user already exists under this username
func RegisterUser ¶
RegisterUser Register a new user with Auth0 and store there user model within the MongoDB database
func ResetUserPassword ¶ added in v1.1.4
ResetUserPassword Send a reset password email to a specified user account.
Types ¶
This section is empty.