diff options
Diffstat (limited to 'src/client/buttons.js')
| -rw-r--r-- | src/client/buttons.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/buttons.js b/src/client/buttons.js index 5fd8d121..dfd2c5f3 100644 --- a/src/client/buttons.js +++ b/src/client/buttons.js @@ -67,6 +67,21 @@ $('.local-storage-load a').click(function(){ rz_core.load_from_json(json_blob); }); +var logout_button = $('#logout-button'); +logout_button.click(function() { + $.ajax({ + type: "POST", + url: '/logout', + success: function () { + document.location = "/login"; + }, + error: function () { + console.log("failed to logout"); + document.location = "/login"; + }, + }); // server should redirect back to /login +}); + $('a.save-history').click(function() { if (rz_core.main_graph.history === undefined) { throw "History is undefined"; |
