user

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: Unlicense Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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

func DeactivateUser(email string) error

DeactivateUser Completely removes the requested user account, both from Auth0 and from MongoDB

func DeleteUser added in v1.1.4

func DeleteUser(email string) error

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

func GetUser(email string) (*userModel.User, error)

GetUser Fetch a user based on their username. Returns ErrNoUser if the user cannot be found

func IndexUsers added in v1.1.4

func IndexUsers(limit int64) ([]*user.User, error)

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

func LoginUser(email string, password string) (*oauth.TokenSet, error)

LoginUser Log a user in with there email address and password and return back an oauth.TokenSet

func NewUser

func NewUser(user *userModel.User) error

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

func RegisterUser(username string, email string, password string) (*userModel.User, error)

RegisterUser Register a new user with Auth0 and store there user model within the MongoDB database

func ResetUserPassword added in v1.1.4

func ResetUserPassword(email string) error

ResetUserPassword Send a reset password email to a specified user account.

Types

This section is empty.

Jump to

Keyboard shortcuts

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