From 63ef3722297c3907e061c3ac621f9253c5b3e361 Mon Sep 17 00:00:00 2001 From: "Alex M. Sielicki" Date: Thu, 21 Jan 2016 21:03:35 +0000 Subject: [PATCH] Passing current location to login page. Addresses #560 --- web-server/js/slycat-navbar.js | 6 +++--- web-server/slycat-login/js/app.js | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web-server/js/slycat-navbar.js b/web-server/js/slycat-navbar.js index 10ff58c6e..ba4956ce7 100644 --- a/web-server/js/slycat-navbar.js +++ b/web-server/js/slycat-navbar.js @@ -391,10 +391,10 @@ define("slycat-navbar", ["slycat-server-root", "slycat-web-client", "slycat-chan component.sign_out = function() { client.sign_out({ - success: function(){ - window.location.href = "/login/slycat-login.html"; + success: function(){ + window.location.href = "/login/slycat-login.html?from=" + window.location.href; }, - error: function(){ + error: function(){ window.alert("Sorry, something went wrong and you are not signed out."); } }) diff --git a/web-server/slycat-login/js/app.js b/web-server/slycat-login/js/app.js index 51a7fd557..a865b34d0 100644 --- a/web-server/slycat-login/js/app.js +++ b/web-server/slycat-login/js/app.js @@ -10,7 +10,8 @@ require(["jquery", "URI"], function($, URI) var sendInfo = JSON.stringify( { "user_name": user_name, - "password": password + "password": password, + "location": window.location, } ); @@ -23,6 +24,7 @@ require(["jquery", "URI"], function($, URI) { console.log("success " + result); window.location.replace("/"); + //window.location.replace(result.target); }, error: function(request, status, reason_phrase) {