diff --git a/README.md b/README.md index 82bbd85..82cf6d3 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,13 @@ Keywind is a component-based Keycloak Login Theme built with [Tailwind CSS](http - Login OAuth Grant - Login OTP - Login Page Expired +- Login Password - Login Recovery Authn Code Config - Login Recovery Authn Code Input - Login Reset Password - Login Update Password - Login Update Profile +- Login Username - Logout Confirm - Register - Select Authenticator diff --git a/theme/keywind/login/login-password.ftl b/theme/keywind/login/login-password.ftl new file mode 100644 index 0000000..54e7d9d --- /dev/null +++ b/theme/keywind/login/login-password.ftl @@ -0,0 +1,39 @@ +<#import "template.ftl" as layout> +<#import "components/atoms/button.ftl" as button> +<#import "components/atoms/button-group.ftl" as buttonGroup> +<#import "components/atoms/form.ftl" as form> +<#import "components/atoms/input.ftl" as input> +<#import "components/atoms/link.ftl" as link> + +<@layout.registrationLayout displayMessage=!messagesPerField.existsError("password"); section> + <#if section="header"> + ${msg("doLogIn")} + <#elseif section="form"> + <@form.kw + action=url.loginAction + method="post" + onsubmit="login.disabled = true; return true;" + > + <@input.kw + autofocus=true + invalid=messagesPerField.existsError("password") + label=msg("password") + message=kcSanitize(messagesPerField.get("password"))?no_esc + name="password" + type="password" + /> + <#if realm.resetPasswordAllowed> +
+ <@link.kw color="primary" href=url.loginResetCredentialsUrl size="small"> + ${msg("doForgotPassword")} + +
+ + <@buttonGroup.kw> + <@button.kw color="primary" name="login" type="submit"> + ${msg("doLogIn")} + + + + + diff --git a/theme/keywind/login/login-username.ftl b/theme/keywind/login/login-username.ftl new file mode 100644 index 0000000..b8064b2 --- /dev/null +++ b/theme/keywind/login/login-username.ftl @@ -0,0 +1,71 @@ +<#import "template.ftl" as layout> +<#import "components/atoms/button.ftl" as button> +<#import "components/atoms/button-group.ftl" as buttonGroup> +<#import "components/atoms/checkbox.ftl" as checkbox> +<#import "components/atoms/form.ftl" as form> +<#import "components/atoms/input.ftl" as input> +<#import "components/atoms/link.ftl" as link> +<#import "components/molecules/identity-provider.ftl" as identityProvider> +<#import "features/labels/username.ftl" as usernameLabel> + +<#assign usernameLabel><@usernameLabel.kw /> + +<@layout.registrationLayout + displayInfo=realm.password && realm.registrationAllowed && !registrationDisabled?? + displayMessage=!messagesPerField.existsError("username") + ; + section +> + <#if section="header"> + ${msg("loginAccountTitle")} + <#elseif section="form"> + <#if realm.password> + <@form.kw + action=url.loginAction + method="post" + onsubmit="login.disabled = true; return true;" + > + <#if !usernameHidden??> + <@input.kw + autocomplete=realm.loginWithEmailAllowed?string("email", "username") + autofocus=true + disabled=usernameEditDisabled?? + invalid=messagesPerField.existsError("username") + label=usernameLabel + message=kcSanitize(messagesPerField.get("username"))?no_esc + name="username" + type="text" + value=(login.username)!'' + /> + + <#if realm.rememberMe && !usernameHidden??> +
+ <@checkbox.kw + checked=login.rememberMe?? + label=msg("rememberMe") + name="rememberMe" + /> +
+ + <@buttonGroup.kw> + <@button.kw color="primary" name="login" type="submit"> + ${msg("doLogIn")} + + + + + <#elseif section="info"> + <#if realm.password && realm.registrationAllowed && !registrationDisabled??> +
+ ${msg("noAccount")} + <@link.kw color="primary" href=url.registrationUrl> + ${msg("doRegister")} + +
+ + <#elseif section="socialProviders"> + <#if realm.password && social.providers??> + <@identityProvider.kw providers=social.providers /> + + + diff --git a/theme/keywind/login/login.ftl b/theme/keywind/login/login.ftl index 60a5d8b..331da06 100644 --- a/theme/keywind/login/login.ftl +++ b/theme/keywind/login/login.ftl @@ -70,9 +70,6 @@ - <#if realm.password && social.providers??> - <@identityProvider.kw providers=social.providers /> - <#elseif section="info"> <#if realm.password && realm.registrationAllowed && !registrationDisabled??>
@@ -82,5 +79,9 @@
+ <#elseif section="socialProviders"> + <#if realm.password && social.providers??> + <@identityProvider.kw providers=social.providers /> + diff --git a/theme/keywind/login/template.ftl b/theme/keywind/login/template.ftl index e7cd58b..2169674 100644 --- a/theme/keywind/login/template.ftl +++ b/theme/keywind/login/template.ftl @@ -56,6 +56,7 @@ + <#nested "socialProviders"> <#assign cardFooter>