diff options
Diffstat (limited to 'public/assets/js/lib/sdk/auth.js')
| -rw-r--r-- | public/assets/js/lib/sdk/auth.js | 7 |
1 files changed, 6 insertions, 1 deletions
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() + }, }) } |
