package
0.0.0-20200917143433-b1b50a11e74b
Repository: https://github.com/al-un/alun-api.git
Documentation: pkg.go.dev
# Functions
SetupUser should only be used in testing files as it creates an user in the database with a specific emailPrefix and a known password.
TearDownUsers deletes one or multiple users from the DB after a test suite.
# Variables
UserAPI exposes User endpoints.
# Structs
BaseUser has the single Email field to strip out any other field sent during a user registration request or password reset request
An BaseUser does not need an ID as it must be transform into an User for being created in the database
BaseUser must be an exportable struct so that `bson` tag works.
Login tracks user login and associated generated token.
PasswordRequest involves an email and a request: - new user creation - password reset request The redirectURL will tell the server which link has to be added in the email.
User represents an entity which can login
db.al_users.insertOne({username:"pouet", password:"plop"}) curl http://localhost:8000/users/register --data '{"username": "plop", "password": "plop"}'.