Giter Club home page Giter Club logo

passport_login's Introduction

Passport_Login

Description

This is a web application that allows users to authenticate and login using Passport authentication.

Features

  • User registration with email and password
  • User login with email and password
  • Passport authentication for user authentication and session management
  • Example protected routes that require authentication
  • Example logout functionality

Technologies Used

  • Node.js
  • Express.js
  • MongoDB
  • Passport.js

Getting Started

  1. Clone the repository: git clone https://github.com/yourusername/your-app.git
  2. Install the dependencies: npm install
  3. Create a .env file based on the provided .env.example file and add your MongoDB URI and session secret.
  4. Start the server: npm start
  5. Visit http://localhost:5000 in your browser.

Configuration

Before running the application, make sure to set up the following environment variables in the .env file:

  • MONGODB_URI: The MongoDB connection URI.
  • SESSION_SECRET: A secret key used for session encryption.

Usage

  • Register a new user by visiting the registration page and providing an email and password.
  • Log in using the registered email and password on the login page.
  • Once logged in, you can access protected routes or customize the application based on your needs.

Project Structure

  • app.js: The entry point of the application.
  • config/passport.js: Passport configuration for authentication strategies.
  • models/User.js: Mongoose model for the User collection.
  • routes/index.js: Routes for the home page, registration, login, and protected routes.
  • views/: Contains the EJS templates for the views.
  • public/: Static assets such as CSS files and client-side JavaScript.

Contributing

Contributions are welcome! If you find any issues or have suggestions, please open an issue or submit a pull request.

passport_login's People

Contributors

sanguleumesh007 avatar sanguleumesh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.