diff options
author | Struan Donald <struan@exo.org.uk> | 2013-04-26 15:06:10 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-04-26 15:17:48 +0100 |
commit | 18e46f5c67fdcda946582a09879b912402055e74 (patch) | |
tree | 0a92fbc8aa0b8234d514e59e641ad16f372efae0 /www/js | |
parent | 276b5fb7903ddea54f3950323a4cf8d6095bd3fd (diff) |
sign out using the api to remove the session cookie
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/views/login.js | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/www/js/views/login.js b/www/js/views/login.js index 5dfd2be..119db8c 100644 --- a/www/js/views/login.js +++ b/www/js/views/login.js @@ -48,10 +48,26 @@ }, onClickLogout: function() { - this.model.set('password', ''); - this.model.save(); - $('#signed_in_row').hide(); - $('#password_row').show(); + var that = this; + $.ajax( { + url: CONFIG.FMS_URL + '/auth/ajax/sign_out', + type: 'GET', + dataType: 'json', + timeout: 30000, + success: function( data, status ) { + FMS.isLoggedIn = 0; + $('#password_row').hide(); + $('#success_row').show(); + that.model.set('password', ''); + that.model.save(); + $('#signed_in_row').hide(); + $('#password_row').show(); + }, + error: function() { + // TODO fix this + alert( 'There was a problem signing you out'); + } + } ); }, validate: function() { |