Skip to content

Conversation

@AA1-34-Ganesh
Copy link
Contributor

📌 Linked Issue

Closes #78

🛠 Changes Made

  • Fixed: Modified handleGoogleLogin and handleFacebookLogin in Login.jsx to prevent execution if API keys are missing.
  • Added: Implemented a defensive check to verify if REACT_APP_GOOGLE_CLIENT_ID or REACT_APP_FACEBOOK_APP_ID are undefined or set to default placeholders.
  • Updated: The UI now displays a user-friendly error message ("Login not configured in this environment") instead of redirecting users to a broken Google/Facebook 401 error page.

🧪 Testing

  • Tested manually:
    • Test case 1: Verified that the application runs locally without crashing on startup.
    • Test case 2: Simulating a Production environment (missing .env keys): Clicked "Sign in with Google". Verified that the app stays on the login page and shows the red error alert instead of redirecting.
    • Test case 3: Verified the same behavior for the Facebook login button.

📸 UI Changes (if applicable)

Feature Before (Crash / Error) After (Safe Error Message)
Google Login Google Before Google After
Facebook Login Facebook Before Facebook After

📝 Documentation Updates

  • Updated README/docs
  • Added code comments

✅ Checklist

💡 Additional Notes

This fix ensures the application remains stable and professional in production environments (like Netlify/Vercel) even if the maintainer has not yet configured the OAuth secrets. It prevents the "Invalid Client" crash that was reported in Issue #78.

@netlify
Copy link

netlify bot commented Jan 7, 2026

Deploy Preview for smartrentsystem ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit e29ab50
🔍 Latest deploy log https://app.netlify.com/projects/smartrentsystem/deploys/695e3fba5bd2570008b3f496
😎 Deploy Preview https://deploy-preview-85--smartrentsystem.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hitesh-kumar123 hitesh-kumar123 added SWoC26 Issues and tasks related to Social Winter of Code (SWoC) contributions. Medium bug Something isn't working labels Jan 10, 2026
@hitesh-kumar123 hitesh-kumar123 merged commit 47a8886 into hitesh-kumar123:main Jan 10, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Medium SWoC26 Issues and tasks related to Social Winter of Code (SWoC) contributions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Google and Facebook Login fails on Production (Netlify) due to invalid placeholder Client IDs.

2 participants