From 54b0a86c2ec52e99ad954387bcf298063872fb24 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 24 Feb 2017 11:44:47 +0100 Subject: [PATCH] Make sure we redirect to the drive if we access the login page from the homepage --- www/common/cryptpad-common.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index c03664036..ae00ba324 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -1176,11 +1176,15 @@ define([ } }); $userAdmin.find('a.login').click(function (e) { - sessionStorage.redirectTo = window.location.href; + if (window.location.pathname !== "/") { + sessionStorage.redirectTo = window.location.href; + } window.location.href = '/login/'; }); $userAdmin.find('a.register').click(function (e) { - sessionStorage.redirectTo = window.location.href; + if (window.location.pathname !== "/") { + sessionStorage.redirectTo = window.location.href; + } window.location.href = '/register/'; });