Remove useDownloadTerms from starter
This commit is contained in:
parent
ed5a867d91
commit
1da42c0ed8
|
@ -1,7 +1,6 @@
|
|||
import { Suspense, lazy } from "react";
|
||||
import type { ClassKey } from "keycloakify/login";
|
||||
import type { KcContext } from "./KcContext";
|
||||
import { useDownloadTerms } from "keycloakify/login";
|
||||
import { useI18n } from "./i18n";
|
||||
import DefaultPage from "keycloakify/login/DefaultPage";
|
||||
import Template from "keycloakify/login/Template";
|
||||
|
@ -14,31 +13,6 @@ const doMakeUserConfirmPassword = true;
|
|||
export default function KcPage(props: { kcContext: KcContext }) {
|
||||
const { kcContext } = props;
|
||||
|
||||
useDownloadTerms({
|
||||
kcContext,
|
||||
downloadTermsMarkdown: async ({ currentLanguageTag }) => {
|
||||
for (const languageTag of [currentLanguageTag, "en"]) {
|
||||
const response = await fetch(
|
||||
`${import.meta.env.BASE_URL}terms/${languageTag}.md`
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return {
|
||||
termsMarkdown: await response.text(),
|
||||
termsLanguageTag: languageTag
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
termsMarkdown: "No terms found",
|
||||
termsLanguageTag: "en"
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const { i18n } = useI18n({ kcContext });
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue