From 817fb034c4cbb396cf4dbfbe52d1f4890689ba6a Mon Sep 17 00:00:00 2001 From: Omer Lachish Date: Wed, 27 Feb 2019 11:02:12 +0200 Subject: [PATCH] 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({