routers/authRouter

Express router providing user related routes

Requires

  • module:express

Namespaces

authRouter

Methods

(static) /login(middleware, controller)

Route for user login.
Source:
Parameters:
Name Type Description
middleware function Middleware function for request body validation using the loginValidator.
controller function Controller function for user login.

(static) /register(middleware, controller)

Route for registering a new user.
Source:
Parameters:
Name Type Description
middleware function Middleware function for request body validation using the registerValidator.
controller function Controller function for user registration.

(static) /whoami(middleware, roles, controller)

Route for getting the current user's information.
Source:
Parameters:
Name Type Description
middleware function Middleware function for JWT authentication and authorization.
roles Array.<string> Array of roles allowed to access this route.
controller function Controller function for getting user information.