Static
authenticateAuthenticate the user using username and password from request body. Uses Passport.js local strategy for authentication.
The HTTP request object containing user credentials
The HTTP response object
The next middleware function
Returns true if authentication is successful, false otherwise
Static
logoutLog out the user by removing req.user property and clearing the login session.
The HTTP request object
Static
successRedirects to the success page after successful authentication. Uses the URL specified in "success_redirect" of config/authentication.js.
The HTTP response object
Static
failureRedirects to the failure page after authentication failure. Uses the URL specified in "failure_redirect" of config/authentication.js. Supports both static URLs and dynamic URL functions.
The HTTP request object
The HTTP response object
User authentication service using Passport.js. Provides methods for user authentication, logout, and redirect handling.
See
Passport.js
Example
Example