Fix some bugs

This commit is contained in:
Joseph Garrone
2021-03-04 23:24:43 +01:00
parent 62e4af2c78
commit 533105d63a
5 changed files with 11 additions and 5 deletions

View File

@ -7,7 +7,8 @@
"realm": { "realm": {
"loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c}, "loginWithEmailAllowed": ${realm.loginWithEmailAllowed?c},
"rememberMe": ${realm.rememberMe?c}, "rememberMe": ${realm.rememberMe?c},
"resetPasswordAllowed": ${realm.resetPasswordAllowed?c} "resetPasswordAllowed": ${realm.resetPasswordAllowed?c},
"registrationAllowed": ${realm.registrationAllowed?c}
}, },
"auth": (function (){ "auth": (function (){
@ -76,6 +77,6 @@
</#if> </#if>
return false; return false;
}) })()
} }
</script> </script>

View File

@ -32,7 +32,7 @@
</#if> </#if>
return false; return false;
}), })(),
"recaptchaRequired": (function (){ "recaptchaRequired": (function (){
<#if passwordRequired??> <#if passwordRequired??>
@ -40,7 +40,7 @@
</#if> </#if>
return false; return false;
}), })(),
"recaptchaSiteKey": "${recaptchaSiteKey}" "recaptchaSiteKey": "${recaptchaSiteKey}"
} }
</script> </script>

View File

@ -32,6 +32,8 @@ export const Login = memo((props: LoginProps) => {
kcContext.pageBasename === "login.ftl" kcContext.pageBasename === "login.ftl"
); );
console.log(kcContext);
return kcContext; return kcContext;
}); });
@ -154,7 +156,7 @@ export const Login = memo((props: LoginProps) => {
displayInfoNode={ displayInfoNode={
( (
realm.password && realm.password &&
realm.resetPasswordAllowed && realm.registrationAllowed &&
!registrationDisabled !registrationDisabled
) && ) &&
<div id="kc-registration"> <div id="kc-registration">

View File

@ -113,6 +113,8 @@ export const Template = memo((props: TemplateProps) => {
return ( return (
<div className={cx(kcProperties.kcLoginClass)}> <div className={cx(kcProperties.kcLoginClass)}>
<h1>REACT</h1>
<div id="kc-header" className={cx(kcProperties.kcHeaderClass)}> <div id="kc-header" className={cx(kcProperties.kcHeaderClass)}>
<div id="kc-header-wrapper" className={cx(kcProperties.kcHeaderWrapperClass)}> <div id="kc-header-wrapper" className={cx(kcProperties.kcHeaderWrapperClass)}>
{t("loginTitleHtml", realm.displayNameHtml)} {t("loginTitleHtml", realm.displayNameHtml)}

View File

@ -62,6 +62,7 @@ export declare namespace KcContext {
loginWithEmailAllowed: boolean; loginWithEmailAllowed: boolean;
rememberMe: boolean; rememberMe: boolean;
resetPasswordAllowed: boolean; resetPasswordAllowed: boolean;
registrationAllowed: boolean;
}; };
auth: { auth: {
selectedCredential?: string; selectedCredential?: string;