feat: support authentik aouth2.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
var ID_LOGIN_BOX_LOGIN_LINK_CONTAINER = "commento-login-box-login-link-container";
|
||||
var ID_LOGIN_BOX_SSO_PRETEXT = "commento-login-box-sso-pretext";
|
||||
var ID_LOGIN_BOX_SSO_BUTTON_CONTAINER = "commento-login-box-sso-buttton-container";
|
||||
var ID_LOGIN_BOX_AUTHENTIK_PRETEXT = "commento-login-box-authentik-pretext";
|
||||
var ID_LOGIN_BOX_AUTHENTIK_BUTTON_CONTAINER = "commento-login-box-authentik-buttton-container";
|
||||
var ID_LOGIN_BOX_HR1 = "commento-login-box-hr1";
|
||||
var ID_LOGIN_BOX_OAUTH_PRETEXT = "commento-login-box-oauth-pretext";
|
||||
var ID_LOGIN_BOX_OAUTH_BUTTONS_CONTAINER = "commento-login-box-oauth-buttons-container";
|
||||
@@ -1599,6 +1601,9 @@
|
||||
var ssoSubtitle = create("div");
|
||||
var ssoButtonContainer = create("div");
|
||||
var ssoButton = create("div");
|
||||
var authentikSubtitle = create("div");
|
||||
var authentikButtonContainer = create("div");
|
||||
var authentikButton = create("div");
|
||||
var hr1 = create("hr");
|
||||
var oauthSubtitle = create("div");
|
||||
var oauthButtonsContainer = create("div");
|
||||
@@ -1623,6 +1628,8 @@
|
||||
loginLinkContainer.id = ID_LOGIN_BOX_LOGIN_LINK_CONTAINER;
|
||||
ssoButtonContainer.id = ID_LOGIN_BOX_SSO_BUTTON_CONTAINER;
|
||||
ssoSubtitle.id = ID_LOGIN_BOX_SSO_PRETEXT;
|
||||
authentikButtonContainer.id = ID_LOGIN_BOX_AUTHENTIK_BUTTON_CONTAINER;
|
||||
authentikSubtitle.id = ID_LOGIN_BOX_AUTHENTIK_PRETEXT;
|
||||
hr1.id = ID_LOGIN_BOX_HR1;
|
||||
oauthSubtitle.id = ID_LOGIN_BOX_OAUTH_PRETEXT;
|
||||
oauthButtonsContainer.id = ID_LOGIN_BOX_OAUTH_BUTTONS_CONTAINER;
|
||||
@@ -1642,6 +1649,9 @@
|
||||
classAdd(ssoSubtitle, "login-box-subtitle");
|
||||
classAdd(ssoButtonContainer, "oauth-buttons-container");
|
||||
classAdd(ssoButton, "oauth-buttons");
|
||||
classAdd(authentikSubtitle, "login-box-subtitle");
|
||||
classAdd(authentikButtonContainer, "oauth-buttons-container");
|
||||
classAdd(authentikButton, "oauth-buttons");
|
||||
classAdd(oauthSubtitle, "login-box-subtitle");
|
||||
classAdd(oauthButtonsContainer, "oauth-buttons-container");
|
||||
classAdd(oauthButtons, "oauth-buttons");
|
||||
@@ -1654,6 +1664,7 @@
|
||||
emailButton.innerText = "Continue";
|
||||
oauthSubtitle.innerText = "Proceed with social login";
|
||||
ssoSubtitle.innerText = "Proceed with " + parent.location.host + " authentication";
|
||||
authentikSubtitle.innerText = "Proceed with " + parent.location.host + " authentication";
|
||||
|
||||
onclick(emailButton, global.passwordAsk, id);
|
||||
onclick(forgotLink, global.forgotPassword, id);
|
||||
@@ -1683,6 +1694,26 @@
|
||||
}
|
||||
});
|
||||
|
||||
if (configuredOauths["authentik"]) {
|
||||
var button = create("button");
|
||||
|
||||
classAdd(button, "button");
|
||||
classAdd(button, "authentik-button");
|
||||
|
||||
button.innerText = "Single Sign-On";
|
||||
|
||||
onclick(button, global.commentoAuth, {"provider": "authentik", "id": id});
|
||||
|
||||
append(authentikButton, button);
|
||||
append(authentikButtonContainer, authentikButton);
|
||||
append(loginBox, authentikSubtitle);
|
||||
append(loginBox, authentikButtonContainer);
|
||||
|
||||
if (numOauthConfigured > 0 || configuredOauths["commento"]) {
|
||||
append(loginBox, hr1);
|
||||
}
|
||||
}
|
||||
|
||||
if (configuredOauths["sso"]) {
|
||||
var button = create("button");
|
||||
|
||||
@@ -1756,6 +1787,12 @@
|
||||
remove($(ID_LOGIN_BOX_HR2));
|
||||
}
|
||||
|
||||
if (configuredOauths["authentik"]) {
|
||||
remove($(ID_LOGIN_BOX_AUTHONTIK_BUTTON_CONTAINER));
|
||||
remove($(ID_LOGIN_BOX_AUTHONTIK_PRETEXT));
|
||||
remove($(ID_LOGIN_BOX_HR1));
|
||||
remove($(ID_LOGIN_BOX_HR2));
|
||||
}
|
||||
if (configuredOauths["sso"]) {
|
||||
remove($(ID_LOGIN_BOX_SSO_BUTTON_CONTAINER));
|
||||
remove($(ID_LOGIN_BOX_SSO_PRETEXT));
|
||||
|
Reference in New Issue
Block a user