Skip to content

MandeepPaul/auth-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

User Authentication with Node.js, Express.js, and MongoDB

This project demonstrates a user authentication system built using Node.js, Express.js, MongoDB, and session management for user login, registration, and access control. User credentials are securely stored in the MongoDB database with MD5 encryption.

Features

  • Login Page: Allows existing users to log in.
  • Invalid Credentials Handling: Displays an error message for invalid login attempts.
  • Registration Page: Enables new users to create an account with credentials securely stored in MongoDB using MD5 encryption.
  • Unauthorized Access Handling: Shows an error when users attempt to access restricted pages without logging in.

Screenshots

Login Page Invalid Credentials
Login Page Invalid Credentials
Registration Page Unauthorized Access Error
Registration Page Unauthorized Access Error
Home Page MongoDB Database
Screenshot 2023-12-10 120126 Screenshot 2023-12-10 122351

Setup Instructions

  1. Clone the repository.
  2. Install dependencies using npm install.
  3. Set up your MongoDB connection by configuring the database in config.js.
  4. Run the application using npm start.
  5. Access the application in your browser at http://localhost:3100.

Usage

  • Visit the login page (http://localhost:3100/login) to log in with existing credentials.
  • To create a new user account, navigate to the registration page (http://localhost:3100/register).
  • Access restricted pages and observe the handling of unauthorized access.

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Sessions

Contributing

Contributions are welcome! Feel free to open issues and pull requests.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published