From 817fb034c4cbb396cf4dbfbe52d1f4890689ba6a Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 27 Feb 2019 11:02:12 +0200 Subject: [PATCH 1/3] append slug to /verification_email endpoint when in MULTI_ORG mode --- client/app/pages/home/index.js | 3 ++- redash/handlers/authentication.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/app/pages/home/index.js b/client/app/pages/home/index.js index 05b167db99..5a91ea034b 100644 --- a/client/app/pages/home/index.js +++ b/client/app/pages/home/index.js @@ -18,7 +18,8 @@ function HomeCtrl(Events, Dashboard, Query, $http, currentUser, toastr) { }); this.verifyEmail = () => { - $http.post('/verification_email/').success(({ message }) => { + const slug = currentUser.org_slug ? `/${currentUser.org_slug}` : ''; + $http.post(`${slug}/verification_email/`).success(({ message }) => { toastr.success(message); }); }; diff --git a/redash/handlers/authentication.py b/redash/handlers/authentication.py index 214d34eac8..f70e5193e1 100644 --- a/redash/handlers/authentication.py +++ b/redash/handlers/authentication.py @@ -266,7 +266,8 @@ def session(org_slug=None): 'email': current_user.email, 'groups': current_user.group_ids, 'permissions': current_user.permissions, - 'is_email_verified': current_user.is_email_verified + 'is_email_verified': current_user.is_email_verified, + 'org_slug': current_user.org.slug if settings.MULTI_ORG else None, } return json_response({ From 2922fa9426537e7b393dca43aba92d41e3835b17 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 27 Feb 2019 11:14:17 +0200 Subject: [PATCH 2/3] Revert "append slug to /verification_email endpoint when in MULTI_ORG mode" This reverts commit 817fb034c4cbb396cf4dbfbe52d1f4890689ba6a. --- client/app/pages/home/index.js | 3 +-- redash/handlers/authentication.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/app/pages/home/index.js b/client/app/pages/home/index.js index 5a91ea034b..05b167db99 100644 --- a/client/app/pages/home/index.js +++ b/client/app/pages/home/index.js @@ -18,8 +18,7 @@ function HomeCtrl(Events, Dashboard, Query, $http, currentUser, toastr) { }); this.verifyEmail = () => { - const slug = currentUser.org_slug ? `/${currentUser.org_slug}` : ''; - $http.post(`${slug}/verification_email/`).success(({ message }) => { + $http.post('/verification_email/').success(({ message }) => { toastr.success(message); }); }; diff --git a/redash/handlers/authentication.py b/redash/handlers/authentication.py index f70e5193e1..214d34eac8 100644 --- a/redash/handlers/authentication.py +++ b/redash/handlers/authentication.py @@ -266,8 +266,7 @@ def session(org_slug=None): 'email': current_user.email, 'groups': current_user.group_ids, 'permissions': current_user.permissions, - 'is_email_verified': current_user.is_email_verified, - 'org_slug': current_user.org.slug if settings.MULTI_ORG else None, + 'is_email_verified': current_user.is_email_verified } return json_response({ From 5ec9910ca015e9f44ba3acde8ee262458cacdd92 Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 27 Feb 2019 11:15:23 +0200 Subject: [PATCH 3/3] fix for /email_verification in MULTI_ORG setups --- client/app/pages/home/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/pages/home/index.js b/client/app/pages/home/index.js index 05b167db99..c8f64caad4 100644 --- a/client/app/pages/home/index.js +++ b/client/app/pages/home/index.js @@ -18,7 +18,7 @@ function HomeCtrl(Events, Dashboard, Query, $http, currentUser, toastr) { }); this.verifyEmail = () => { - $http.post('/verification_email/').success(({ message }) => { + $http.post('verification_email/').success(({ message }) => { toastr.success(message); }); };