Return undefined if the context dosen't match the theme

This commit is contained in:
garronej
2023-03-21 18:32:00 +01:00
parent 09543400ca
commit 2e4d722d7f
2 changed files with 8 additions and 0 deletions

View File

@ -62,6 +62,10 @@ export function getKcContext<KcContextExtension extends { pageId: string } = nev
return { "kcContext": undefined };
}
if (!("account" in realKcContext)) {
return { "kcContext": undefined };
}
{
const { url } = realKcContext;

View File

@ -121,6 +121,10 @@ export function getKcContext<KcContextExtension extends { pageId: string } = nev
return { "kcContext": undefined };
}
if (!("login" in realKcContext)) {
return { "kcContext": undefined };
}
{
const { url } = realKcContext;