fix(dropbox): fix Invalid redirect_uri error by adding PUBLIC_BASE_URL config and URL-encoding
- Add PUBLIC_BASE_URL optional config to override auto-detected OAuth redirect URIs when behind a reverse proxy that doesn't forward X-Forwarded-Proto headers - Add _build_dropbox_redirect_uri() helper in app/api/dropbox.py - URL-encode redirect_uri in server-side Dropbox authorization URL - Add _get_dropbox_callback_url() helper in app/views/dropbox.py - Pass callback_url to both setup and callback templates - Update templates to use server-provided callback_url instead of window.location.origin - Update settings_service.py to register new setting - Update .env.demo, ConfigurationGuide.md, and DropboxSetup.md documentation - Add tests for new helper functions and global-authorize-url endpoint Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -108,7 +108,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
}
|
||||
}
|
||||
|
||||
const redirectUri = window.location.origin + "/dropbox-callback";
|
||||
// Use server-provided callback URL (respects PUBLIC_BASE_URL) with fallback to window.location.origin
|
||||
const redirectUri = {{ callback_url | tojson }} || (window.location.origin + "/dropbox-callback");
|
||||
|
||||
// Automatically exchange the code for a refresh token
|
||||
if (code) {
|
||||
|
||||
Reference in New Issue
Block a user