From 3a42fe7ad797a6f9cf747d2d358015ac992765a7 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 14 Dec 2017 19:53:31 +0100 Subject: change password - profile stuff --- public/assets/js/lib/sdk/auth.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'public/assets/js/lib/sdk/auth.js') diff --git a/public/assets/js/lib/sdk/auth.js b/public/assets/js/lib/sdk/auth.js index c720292..0b49449 100644 --- a/public/assets/js/lib/sdk/auth.js +++ b/public/assets/js/lib/sdk/auth.js @@ -70,6 +70,7 @@ var auth = (function(){ $.ajax({ method: 'put', url: '/api/checkin', + headers: { "csrf-token": $("[name=_csrf]").attr("value") }, success: function(data){ if (data && data.user && data.user.id !== -1) { auth.set_user(data.user) @@ -77,7 +78,11 @@ var auth = (function(){ return } opt.error() - } + }, + error: function(){ + window.location.href = '/login' + opt.error() + }, }) } -- cgit v1.2.3-70-g09d2