{"id":18848692,"url":"https://github.com/ajaykumar2pp/multi-authentication-nodejs","last_synced_at":"2026-04-13T14:33:34.575Z","repository":{"id":260604821,"uuid":"881796421","full_name":"ajaykumar2pp/Multi-Authentication-NodeJS","owner":"ajaykumar2pp","description":"Multi Authentication (Google \u0026 GitHub) using NodeJS","archived":false,"fork":false,"pushed_at":"2025-02-21T02:12:52.000Z","size":563,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T01:45:12.670Z","etag":null,"topics":["ejs","express-flash","express-session","expressjs","mongoose","nodejs","nodemailer","passport"],"latest_commit_sha":null,"homepage":"https://gkv-ac-in.onrender.com","language":"EJS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajaykumar2pp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-01T08:48:39.000Z","updated_at":"2025-02-21T02:12:55.000Z","dependencies_parsed_at":"2025-05-26T05:46:02.049Z","dependency_job_id":null,"html_url":"https://github.com/ajaykumar2pp/Multi-Authentication-NodeJS","commit_stats":null,"previous_names":["ajaykumar2pp/multi-auth-nodejs","ajaykumar2pp/multi-authentication-nodejs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ajaykumar2pp/Multi-Authentication-NodeJS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaykumar2pp%2FMulti-Authentication-NodeJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaykumar2pp%2FMulti-Authentication-NodeJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaykumar2pp%2FMulti-Authentication-NodeJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaykumar2pp%2FMulti-Authentication-NodeJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajaykumar2pp","download_url":"https://codeload.github.com/ajaykumar2pp/Multi-Authentication-NodeJS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaykumar2pp%2FMulti-Authentication-NodeJS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279087551,"owners_count":26100425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ejs","express-flash","express-session","expressjs","mongoose","nodejs","nodemailer","passport"],"created_at":"2024-11-08T03:16:52.547Z","updated_at":"2025-10-15T15:33:41.643Z","avatar_url":"https://github.com/ajaykumar2pp.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Multi-Authentication System 🚀\n\nThis project is a multi-authentication system that includes features such as user registration, login, logout, and authentication via Google and GitHub OAuth. Additionally, it provides a user dashboard\n\n## 🌟 Features\n\n- 🔒 **User Registration and Login**\n  - Traditional email and password authentication using Passport.js.\n- 🌐 **OAuth Integration**\n  - Google and GitHub authentication support.\n- 📧 **Forget Password Flow**\n  - Reset your password securely via email.\n- 🛠️ **Dashboard**\n  - A protected route accessible only to authenticated users.\n- 🎨  **Responsive Design**\n  - UI built with EJS and Bootstrap.\n\n## 🚀 Tech Stack\n\n| Technology        | Description                 |\n| ----------------- | --------------------------- |\n| 📦 **NPM**        | Dependency management       |\n| ⚛️ **EJS**   | Frontend library            |\n| 🟢 **Node.js**    | Backend runtime environment |\n| ⚡ **Express.js** | Backend web framework       |\n| 🔑 **Passport.js**        | Authentication middleware  |\n| ✉️ **Nodemailer**        | Email Service for password reset  |\n| 🗄️ **MongoDB**    | NoSQL Database for user data           |\n\n## 🚀 Installation and Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/ajaykumar2pp/Multi-Authentication-NodeJS\n   ```\n2. Navigate to the project directory:\n   ```bash\n    cd multi-authentication\n   ```\n3. Install dependencies:\n   ```bash\n   npm install\n   ```\n4. Set up environment variables:\n   ```bash\n   DATABASE_URL=mongodb+srv://\u003cusername\u003e:\u003cpassword\u003emongodb.net/USER_AUTH?retryWrites=true\u0026w=majority\n   JWT_SECRET=themyscret\n   GOOGLE_CLIENT_ID=**6444762183-***************************.apps.googleusercontent.com\n   GOOGLE_CLIENT_SECRET=GOCSPX-VGOKmLZdJx2oJ2WxON_***********\n   EMAIL_USER=abc@gmail.com\n   EMAIL_PASS=tsqp **** **** jeym\n   GOOGLE_CALLBACK_URL=https://abc-coder-in.onrender.com/auth/google/callback\n   GITHUB_CLIENT_ID=Ov23li8zO2Uw8c7******\n   GITHUB_CLIENT_SECRET=ab882befa44617**********56695388fd7d1b07\n   GITHUB_CALLBACK_URL=https://abc-coder-in.onrender.com/auth/github/callback\n   ```\n5. Start the development server:\n   ```bash\n   npm start\n   ```\n\n\n## 📁 Project Structure\n\n```\nMulti-Authentication/\nsrc/\n├── config/                  # Configuration files\n│   └── db.config.js         # Database connection configuration\n│   └── nodemailer.js        # Email service setup\n├── controllers/             # Route controllers\n│   └── userController.js    # Controller for authentication-related logic\n├── middlewares/             # Custom middleware\n│   └── auth.middleware.js   # Middleware for authentication and authorization\n├── models/                  # Database models\n│   └── user.model.js        # User schema and model definition\n├── passport/                # Passport.js strategies\n│   └── passport.js          # Passport-Local, Google \u0026 GitHub strategies\n├── routes/                  # Application routes\n│   └── userRoutes.js        # Routes related to authentication\n├── views/                   # EJS templates\n├── .env.example             # Sample environment file\n├── index.js                 # Main entry point for the server\n├── package.json             # Project configuration\n├── README.md                # Documentation\n```\n\n## 🚦 API Endpoints\n\n| HTTP Method | Endpoint                  | Description                                    |\n|--------------|---------------------------|------------------------------------------------|\n| `GET`        | `/register`                | Displays the registration page.               |\n| `POST`       | `/register`                | Registers a new user.                         |\n| `GET`        | `/login`                   | Displays the login page.                      |\n| `POST`       | `/login`                   | Logs in the user.                             |\n| `GET`        | `/auth/google`             | Initiates Google OAuth.                       |\n| `GET`        | `/auth/google/callback`    | Google OAuth callback.                        |\n| `GET`        | `/auth/github`             | Initiates GitHub OAuth.                       |\n| `GET`        | `/auth/github/callback`    | GitHub OAuth callback.                        |\n| `GET`        | `/dashboard`               | Displays the dashboard for logged-in users.   |\n| `GET`        | `/forget-password`         | Displays the forget password page.            |\n| `POST`       | `/forget-password`         | Sends reset password email.                   |\n| `GET`        | `/check-email`             | Prompts user to check email for reset link.   |\n| `GET`        | `/reset-password/:token`   | Displays the reset password page.             |\n| `POST`       | `/reset-password/:token`   | Resets the user password.                     |\n| `GET`        | `/success`                 | Displays success page.                        |\n| `GET`        | `/logout`                  | Logs the user out.                            |\n\n\n\n## 📷 Screenshots\n\n## 🛡️ Security\n\n- Encrypted passwords using bcrypt 🔒.\n- Secure OAuth flows with Google and GitHub.\n- Environment variables stored securely with dotenv.\n\n## 📞 Contact\n\n- 👤 Author: Ajay Kumar Prajapati\n- 📧 Email: ajay2kumarpp@gmail.com\n- 🌐 Github: https://github.com/ajaykumar2pp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaykumar2pp%2Fmulti-authentication-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajaykumar2pp%2Fmulti-authentication-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaykumar2pp%2Fmulti-authentication-nodejs/lists"}