Skip to content

Conversation

@MODSetter
Copy link
Owner

@MODSetter MODSetter commented Jan 2, 2026

Please work

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR fixes Google OAuth authentication issues in Firefox and Safari browsers by implementing a redirect-based authorization flow. The changes address cross-site cookie problems where CSRF tokens set via cross-origin fetch requests weren't being sent on subsequent redirects. The frontend now uses a new /auth/google/authorize-redirect endpoint that performs server-side redirection to Google OAuth, and the backend has been updated to properly configure CSRF cookies with appropriate domain settings and a new redirect endpoint that sets cookies in a same-site context.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/app/(home)/login/GoogleLoginButton.tsx
2 surfsense_backend/app/app.py

Need help? Join our Discord

Analyze latest changes

- Added a new endpoint `/auth/google/authorize-redirect` to handle OAuth authorization via server-side redirect, addressing CSRF cookie issues in Firefox/Safari.
- Updated the `GoogleLoginButton` component to use the new redirect endpoint instead of the previous JSON-based authorization method.
- Enhanced CSRF cookie handling by explicitly setting the cookie domain and ensuring compatibility with cross-origin requests.
@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
surf-sense-frontend Building Building Preview, Comment Jan 2, 2026 8:26am

@MODSetter MODSetter merged commit ae1c3f9 into main Jan 2, 2026
4 of 6 checks passed
Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on a64ab89..458c152

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (1)

surfsense_web/app/(home)/login/GoogleLoginButton.tsx

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.

2 participants