Social is now optional on the kcContext

This commit is contained in:
Joseph Garrone 2024-09-09 07:51:49 +02:00
parent 28990a12da
commit b8a08f0789
4 changed files with 5 additions and 17 deletions

View File

@ -188,7 +188,7 @@ export declare namespace KcContext {
password?: string;
};
usernameHidden?: boolean;
social: {
social?: {
displayInfo: boolean;
providers?: {
loginUrl: string;
@ -325,7 +325,7 @@ export declare namespace KcContext {
rememberMe?: string;
};
usernameHidden?: boolean;
social: Login["social"];
social?: Login["social"];
};
export type LoginPassword = Common & {
@ -343,9 +343,6 @@ export declare namespace KcContext {
showTryAnotherWayLink?: boolean;
attemptedUsername?: string;
};
social: {
displayInfo: boolean;
};
};
export type WebauthnAuthenticate = Common & {
@ -360,9 +357,6 @@ export declare namespace KcContext {
createTimeout: string;
isUserIdentified: "true" | "false";
shouldDisplayAuthenticators: boolean;
social: {
displayInfo: boolean;
};
login: {};
realm: {
password: boolean;

View File

@ -326,9 +326,6 @@ export const kcContextMocks = [
realm: {
...kcContextCommonMock.realm,
resetPasswordAllowed: true
},
social: {
displayInfo: false
}
}),
id<KcContext.WebauthnAuthenticate>({
@ -349,9 +346,6 @@ export const kcContextMocks = [
createTimeout: "0",
isUserIdentified: "false",
shouldDisplayAuthenticators: false,
social: {
displayInfo: false
},
login: {}
}),
id<KcContext.LoginUpdatePassword>({
@ -584,7 +578,7 @@ export const kcContextMocks = [
challenge: "",
userVerification: "not specified",
rpId: "",
createTimeout: "0",
createTimeout: 0,
authenticators: {
authenticators: []
},

View File

@ -43,7 +43,7 @@ export default function Login(props: PageProps<Extract<KcContext, { pageId: "log
}
socialProvidersNode={
<>
{realm.password && social.providers !== undefined && social.providers.length !== 0 && (
{realm.password && social?.providers !== undefined && social.providers.length !== 0 && (
<div id="kc-social-providers" className={kcClsx("kcFormSocialAccountSectionClass")}>
<hr />
<h2>{msg("identity-provider-login-label")}</h2>

View File

@ -40,7 +40,7 @@ export default function LoginUsername(props: PageProps<Extract<KcContext, { page
headerNode={msg("doLogIn")}
socialProvidersNode={
<>
{realm.password && social.providers !== undefined && social.providers.length !== 0 && (
{realm.password && social?.providers !== undefined && social.providers.length !== 0 && (
<div id="kc-social-providers" className={kcClsx("kcFormSocialAccountSectionClass")}>
<hr />
<h2>{msg("identity-provider-login-label")}</h2>