mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 15:45:55 +08:00
33 lines
926 B
JavaScript
33 lines
926 B
JavaScript
(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);
|
|
|