From 0978e2dc2bc3d346ba0d2f3994c10d170aa67502 Mon Sep 17 00:00:00 2001 From: Jan-Willem Gmelig Meyling Date: Sun, 9 Apr 2017 22:21:07 +0200 Subject: [PATCH] Partial solution for #412 Partial fix for #412 by redirecting the user to the login page if the update request fails. However, due to adblock limitations, this approach is not guaranteed to work. A proper solution should exist of creating an login API endpoint and a JS login dialog. --- src/main/resources/static/js/assignment-rubrics.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/static/js/assignment-rubrics.js b/src/main/resources/static/js/assignment-rubrics.js index 927efe7a..462591c5 100644 --- a/src/main/resources/static/js/assignment-rubrics.js +++ b/src/main/resources/static/js/assignment-rubrics.js @@ -83,6 +83,13 @@ module.controller('StatisticsControl', function($scope, $http, $q) { if (assignment) { $http.put('json', assignment).then(function(res) { $scope.assignment = res.data; + }, function() { + try { + location.reload(); + } + catch (e) { + alert('Your session expired, please login.'); + } }); } };