Allow adminAuth to auto-login users when using passport strategy

Fixes #3467
This commit is contained in:
Nick O'Leary
2022-04-04 21:23:39 +01:00
parent cb88409102
commit b8435efc97
2 changed files with 25 additions and 13 deletions

View File

@@ -106,9 +106,15 @@ async function login(req,res) {
urlPrefix += "/";
}
response = {
"type":"strategy",
"prompts":[{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}]
"type":"strategy"
}
if (mergedAdminAuth.strategy.autoLogin) {
response.autoLogin = true
response.loginRedirect = urlPrefix + "auth/strategy"
}
response.prompts = [
{type:"button",label:mergedAdminAuth.strategy.label, url: urlPrefix + "auth/strategy"}
]
if (mergedAdminAuth.strategy.icon) {
response.prompts[0].icon = mergedAdminAuth.strategy.icon;
}