Split kcContext among pages
This commit is contained in:
@ -3,8 +3,8 @@ import { useState, memo } from "react";
|
||||
import { Template } from "./Template";
|
||||
import type { KcPagesProperties } from "./KcProperties";
|
||||
import { defaultKcPagesProperties } from "./KcProperties";
|
||||
import { assert } from "evt/tools/typeSafety/assert";
|
||||
import { kcContext } from "../kcContext";
|
||||
import { assert } from "../tools/assert";
|
||||
import { kcContext } from "../kcContext";
|
||||
import { useKcTranslation } from "../i18n/useKcTranslation";
|
||||
import { cx } from "tss-react";
|
||||
import { useConstCallback } from "powerhooks";
|
||||
@ -25,13 +25,16 @@ export const Login = memo((props: LoginProps) => {
|
||||
social, realm, url,
|
||||
usernameEditDisabled, login,
|
||||
auth, registrationDisabled
|
||||
}] = useState(() => (
|
||||
}] = useState(() => {
|
||||
|
||||
assert(
|
||||
kcContext !== undefined,
|
||||
"App is currently being served by keycloak"
|
||||
),
|
||||
kcContext
|
||||
));
|
||||
kcContext !== undefined &&
|
||||
kcContext.pageBasename === "login.ftl"
|
||||
);
|
||||
|
||||
return kcContext;
|
||||
|
||||
});
|
||||
|
||||
const [isLoginButtonDisabled, setIsLoginButtonDisabled] = useState(false);
|
||||
|
||||
|
Reference in New Issue
Block a user