-
-
Notifications
You must be signed in to change notification settings - Fork 839
feat: add BACKEND_URL configuration for OAuth redirect #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Introduced BACKEND_URL in the configuration to allow overriding the HTTP to HTTPS in the OAuth redirect URI. - Updated the Google OAuth router to conditionally use the BACKEND_URL for the redirect URI when specified.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThe pull request introduces environment-based configuration for Google OAuth redirect URL handling. A new BACKEND_URL configuration option is added and used to conditionally modify the OAuth router construction, enabling the redirect URI to be dynamically set when the environment variable is present. Changes
Sequence Diagram(s)sequenceDiagram
participant Env as Environment
participant Config as Config Class
participant App as app.py
participant Router as OAuth Router
Env->>Config: BACKEND_URL (if present)
Config->>App: config.BACKEND_URL
alt BACKEND_URL is set
App->>Router: Create with redirect_url={BACKEND_URL}/auth/google/callback
else BACKEND_URL not set
App->>Router: Create with default is_verified_by_default=True
end
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this 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 5174f21..4a3f681
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (2)
• surfsense_backend/app/app.py
• surfsense_backend/app/config/__init__.py
Description
feat: add BACKEND_URL configuration for OAuth redirect
Motivation and Context
To override google oauth redirect.
Screenshots
API Changes
Change Type
Testing Performed
Checklist
High-level PR Summary
This PR adds a new optional
BACKEND_URLenvironment variable to allow overriding the OAuth redirect URL for Google authentication. WhenBACKEND_URLis configured, the Google OAuth router uses a custom redirect URL pointing to{BACKEND_URL}/auth/google/callbackinstead of the default, which is useful for scenarios where the backend needs to force HTTPS redirects or handle proxy/load balancer configurations.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_backend/app/config/__init__.pysurfsense_backend/app/app.py