Check if the username already exists in the DB, otherwise therell be an internal server error
Return the
For /api/auth/login
Check if the username is valid before checking the password (because user.check_password(body.get('password')) results in an error if user does not exist)
Along with the token, return the user's id, the user's list of contacts and the user's list of groups.
For
/api/auth/register
For
/api/auth/login
user.check_password(body.get('password'))
results in an error if user does not exist)