Add JWT authentication with password reset and 15 coding problems, and Google OAuth#55
Open
Aishwarya011k wants to merge 3 commits intoosl-vvce:masterfrom
Open
Add JWT authentication with password reset and 15 coding problems, and Google OAuth#55Aishwarya011k wants to merge 3 commits intoosl-vvce:masterfrom
Aishwarya011k wants to merge 3 commits intoosl-vvce:masterfrom
Conversation
- Added user signup and login endpoints with JWT authentication. - Integrated email verification and password reset functionality using OTP. - Created a SQLite database schema for users, submissions, and OTPs. - Implemented email sending via SMTP and SendGrid. - Updated frontend to handle authentication states and user account management. - Added components for user authentication forms and account details. - Included environment configuration for sensitive data.
feat: create problems.js file with various coding problems and templates feat: implement authService for user authentication and password management
- Added passport and passport-google-oauth20 dependencies for Google OAuth integration. - Updated user model to include google_id, profile_picture, and auth_provider fields. - Modified signup and signin controllers to handle local and Google OAuth users. - Created Google OAuth routes and controllers for redirecting and handling callbacks. - Enhanced user profile retrieval to include OAuth-related fields. - Updated frontend components to support Google sign-in and display user profile information. - Implemented JWT generation for authenticated users via Google OAuth.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 Description
✨ What's Included
Authentication System
Password Reset
Coding Problems
🧪 How to Test
Prerequisites
Setup Steps
Install dependencies
Create database
Create
server/.envStart backend (Terminal 1)
Expected:
✅ Server listening on port 3001Start frontend (Terminal 2)
Expected: App opens at http://localhost:3000
Test Cases
Test 1: Sign Up
Test 2: Sign In
Test 3: Google OAuth Sign In
Test 4: Account Linking
Test 5: View Profile
Test 6: Forgot Password
Test 7: Reset Password
Test 8: View Problems
🔒 Security
✅ Passwords encrypted with bcrypt (10 rounds)
✅ JWT tokens expire after 7 days
✅ Reset tokens expire after 15 minutes
✅ Google OAuth 2.0 secure authentication
✅ Account linking prevents duplicate accounts
✅ Profile data securely retrieved from Google
✅ .env file gitignored (no secrets exposed)
✅ SQL injection prevented (parameterized queries)
✅ Input validation on all endpoints
✅ Helmet security headers enabled
✅ CORS configured
📊 Database Schema
New OAuth Fields:
google_id: Google OAuth unique identifierprofile_picture: User's profile image URLauth_provider: "local" or "google" (determines auth method)🎯 API Endpoints
/api/auth/signup/api/auth/signin/api/auth/signout/api/auth/profile/api/auth/forgot-password/api/auth/reset-password/api/auth/google/api/auth/google/callback✅ Conclusion
This PR introduces a complete authentication system with secure password reset functionality, 15 comprehensive coding problems, and seamless Google OAuth integration. Users can now register, login securely with email/password or Google, reset forgotten passwords, and access coding challenges.