feat: show SAML cert parse error better in frontend (#3551)

This commit is contained in:
DacongDA 2025-02-05 10:06:02 +08:00 committed by GitHub
parent df295717f0
commit ca60cc3a33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,6 +44,7 @@ import KwaiLoginButton from "./KwaiLoginButton";
import LoginButton from "./LoginButton";
import * as AuthBackend from "./AuthBackend";
import {WechatOfficialAccountModal} from "./Util";
import * as Setting from "../Setting";
function getSigninButton(provider) {
const text = i18next.t("login:Sign in with {type}").replace("{type}", provider.displayName !== "" ? provider.displayName : provider.type);
@ -114,11 +115,15 @@ function goToSamlUrl(provider, location) {
const relayState = `${clientId}&${state}&${providerName}&${realRedirectUri}&${redirectUri}`;
AuthBackend.getSamlLogin(`${provider.owner}/${providerName}`, btoa(relayState)).then((res) => {
if (res.status === "ok") {
if (res.data2 === "POST") {
document.write(res.data);
} else {
window.location.href = res.data;
}
} else {
Setting.showMessage("error", res.msg);
}
});
}