mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
added automatic login
This commit is contained in:
parent
f6eab84d40
commit
081726d764
2 changed files with 63 additions and 1 deletions
32
plugins/proxy-auth/js/auto-login.js
Normal file
32
plugins/proxy-auth/js/auto-login.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
(rl => {
|
||||
|
||||
rl && addEventListener('rl-view-model', e => {
|
||||
const id = e.detail.viewModelTemplateID;
|
||||
if (e.detail && ('Login' === id)) {
|
||||
let
|
||||
auto_login = window.rl.pluginSettingsGet('proxy-auth', 'auto_login');
|
||||
;
|
||||
|
||||
const
|
||||
ForwardProxyAuth = () => {
|
||||
if (auto_login) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "/?UserHeaderSet", true);
|
||||
|
||||
xhr.onreadystatechange = function () {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
window.location.href = "/?ProxyAuth";
|
||||
}
|
||||
};
|
||||
|
||||
xhr.send();
|
||||
}
|
||||
};
|
||||
|
||||
window.ForwardProxyAuth = ForwardProxyAuth;
|
||||
|
||||
ForwardProxyAuth();
|
||||
}
|
||||
});
|
||||
})(window.rl);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue