diff options
Diffstat (limited to 'interface/js/rspamd.js')
-rw-r--r-- | interface/js/rspamd.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/interface/js/rspamd.js b/interface/js/rspamd.js index 9d5b46944..ec273f27f 100644 --- a/interface/js/rspamd.js +++ b/interface/js/rspamd.js @@ -309,6 +309,26 @@ } // @show widgets function statWidgets() { + $.ajax({ + dataType: 'json', + type: 'GET', + url: 'auth', + jsonp: false, + beforeSend: function (xhr) { + xhr.setRequestHeader('Password', getPassword()); + }, + success: function (data) { + if (!supportsSessionStorage()) { + $.cookie('rspamdsession', data, { + expires: 1 + }, { + path: '/' + }); + } else { + sessionStorage.setItem('Credentials', JSON.stringify(data)); + } + } + }); var widgets = $('#statWidgets'); $(widgets).empty().hide(); var data; |