forked from RainLoop/rainloop-webmail
-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1400 from PhilippMundhenk/master
Automatic login for ProxyAuth plugin, improved security documentation
- Loading branch information
Showing
3 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|