summaryrefslogtreecommitdiff
path: root/service/pixelated
diff options
context:
space:
mode:
authorTulio Casagrande <tcasagra@thoughtworks.com>2017-02-13 15:23:11 -0200
committerTulio Casagrande <tcasagra@thoughtworks.com>2017-02-13 15:23:11 -0200
commit7fdf9f62c785835c4ea0863dae36bee9611221a5 (patch)
tree450662487d2489d78491bc56d04aa65c451ce2e6 /service/pixelated
parent0edf2078caf98be00bcd48846acec563df630616 (diff)
[#907] Change login status to return json
with @anikarni
Diffstat (limited to 'service/pixelated')
-rw-r--r--service/pixelated/assets/Interstitial.js2
-rw-r--r--service/pixelated/resources/login_resource.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/service/pixelated/assets/Interstitial.js b/service/pixelated/assets/Interstitial.js
index cda56a4b..2eaa7a1c 100644
--- a/service/pixelated/assets/Interstitial.js
+++ b/service/pixelated/assets/Interstitial.js
@@ -44,7 +44,7 @@ $(function () {
method: 'GET',
url: '/login/status'
}).success(function (data) {
- if (data === 'completed' || data === 'error') {
+ if (data.status === 'completed' || data.status === 'error') {
window.location="/";
}
});
diff --git a/service/pixelated/resources/login_resource.py b/service/pixelated/resources/login_resource.py
index 77ebca70..4bbceb89 100644
--- a/service/pixelated/resources/login_resource.py
+++ b/service/pixelated/resources/login_resource.py
@@ -20,7 +20,7 @@ from xml.sax import SAXParseException
from pixelated.authentication import Authenticator
from pixelated.config.leap import BootstrapUserServices
from pixelated.resources import BaseResource, UnAuthorizedResource, IPixelatedSession
-from pixelated.resources import get_startup_folder
+from pixelated.resources import get_startup_folder, respond_json
from twisted.cred.error import UnauthorizedLogin
from twisted.internet import defer
from twisted.logger import Logger
@@ -176,4 +176,5 @@ class LoginStatusResource(BaseResource):
def render_GET(self, request):
session = IPixelatedSession(request.getSession())
- return format(session.check_login_status())
+ response = {'status': str(session.check_login_status())}
+ return respond_json(response, request)