aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2022-06-13 11:39:21 +0200
committersonartech <sonartech@sonarsource.com>2022-06-28 20:02:53 +0000
commit54732569670fc345367062d5b20fcca83d9f7692 (patch)
tree8a3d86a9b76fbc056b74ac68ff8b38db9cee2cb1 /server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts
parent26675093303e38f1973f3ee9da5750aeeb2a5a5f (diff)
downloadsonarqube-54732569670fc345367062d5b20fcca83d9f7692.tar.gz
sonarqube-54732569670fc345367062d5b20fcca83d9f7692.zip
SONAR-16045 Migrate react-router to 6.3.0
Co-authored-by: Jeremy Davis <jeremy.davis@sonarsource.com> Co-authored-by: Guillaume Péoc'h <guillaume.peoch@sonarsource.com>
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts')
-rw-r--r--server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts b/server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts
index 75a046a24f9..fbf9c568551 100644
--- a/server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts
+++ b/server/sonar-web/src/main/js/helpers/handleRequiredAuthentication.ts
@@ -17,11 +17,8 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import getHistory from './getHistory';
-
export default function handleRequiredAuthentication() {
- const history = getHistory();
const returnTo = window.location.pathname + window.location.search + window.location.hash;
- // eslint-disable-next-line camelcase
- history.replace({ pathname: '/sessions/new', query: { return_to: returnTo } });
+ const searchParams = new URLSearchParams({ return_to: returnTo });
+ window.location.replace(`/sessions/new?${searchParams.toString()}`);
}