services/auth

Service for user authentication, including registration and login.

Methods

(static) login(email, password) → {Promise.<UserDTO>}

Logs a user into the system.
Source:
Parameters:
Name Type Description
email * The user's email.
password * The user's password.
Returns:
Type:
Promise.<UserDTO>
A promise that resolves with the authenticated user as a UserDTO instance, or null if authentication fails.

(static) register(userToAdd) → {Promise.<UserDTO>}

Registers a new user account in the system.
Source:
Parameters:
Name Type Description
userToAdd * The user data to add.
Returns:
Type:
Promise.<UserDTO>
A promise that resolves with the created user as a UserDTO instance, or null if creation fails.