|
@@ -1,7 +1,5 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import { getLocationContextRoot } from '../base/util';
|
4
|
|
-
|
5
|
3
|
import { UPDATE_DROPBOX_TOKEN } from './actionTypes';
|
6
|
4
|
import { _authorizeDropbox } from './functions';
|
7
|
5
|
|
|
@@ -15,8 +13,14 @@ export function authorizeDropbox() {
|
15
|
13
|
const state = getState();
|
16
|
14
|
const { locationURL } = state['features/base/connection'];
|
17
|
15
|
const { dropbox = {} } = state['features/base/config'];
|
18
|
|
- const redirectURI = `${locationURL.origin
|
19
|
|
- + getLocationContextRoot(locationURL)}static/oauth.html`;
|
|
16
|
+
|
|
17
|
+ // By default we use the static page on the main domain for redirection.
|
|
18
|
+ // So we need to setup only one redirect URI in dropbox app
|
|
19
|
+ // configuration (not multiple for all the tenants).
|
|
20
|
+ // In case deployment is running in subfolder dropbox.redirectURI
|
|
21
|
+ // can be configured.
|
|
22
|
+ const redirectURI
|
|
23
|
+ = dropbox.redirectURI || `${locationURL.origin}/static/oauth.html`;
|
20
|
24
|
|
21
|
25
|
_authorizeDropbox(dropbox.appKey, redirectURI)
|
22
|
26
|
.then(
|