Skip to content

bugFix#65

Open
amans2003 wants to merge 1 commit into
bradtraversy:mainfrom
amans2003:amanSignup
Open

bugFix#65
amans2003 wants to merge 1 commit into
bradtraversy:mainfrom
amans2003:amanSignup

Conversation

@amans2003

Copy link
Copy Markdown

🚀 Overview
This PR implements Google OAuth authentication for the ProShop-v2 application, allowing users to sign up and log in using their Google accounts. It also includes critical fixes for Node.js v25 compatibility and macOS port conflicts.

bug#62

✨ New Features
🔐 Google OAuth Integration
Frontend Integration: Added @react-oauth/google and integrated the GoogleOAuthProvider.
Reusable Components: Created a GoogleLoginButton component that handles the OAuth flow and communicates with the backend.
Enhanced UI: Added the Google login option to both the Login and Registration screens.
Unified Auth: Implemented logic to automatically link Google accounts to existing accounts if the emails match.
🛠 Backend Enhancements
User Model Update: Added googleId field and made password optional for OAuth-based users.
Secure Verification: Integrated google-auth-library to securely verify Google ID tokens on the server side.
Environment Configuration: Added support for GOOGLE_CLIENT_ID in environment variables.
🐛 Bug Fixes & Compatibility
Node.js v25 Fix: Upgraded jsonwebtoken to v9.0.2 to resolve the TypeError: Cannot read properties of undefined (reading 'prototype') error caused by the removal of SlowBuffer in newer Node versions.
macOS Port Conflict: Changed the default backend port from 5000 to 5001 to prevent conflicts with the macOS AirPlay Receiver service, which frequently causes 403 Forbidden errors on port 5000.
Proxy Update: Updated the frontend development proxy to correctly route requests to the new backend port.
📝 Configuration Requirements
To enable Google OAuth, the following environment variables must be set:

Backend (.env): GOOGLE_CLIENT_ID
Frontend (frontend/.env): REACT_APP_GOOGLE_CLIENT_ID

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant