From 2c83ddc9d01d3c21462bb9bd0b4a9ddc84c92946 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Mon, 30 Sep 2024 13:51:41 +0200 Subject: [PATCH] reuse social providers (#33107) fixes: #33054 Signed-off-by: Erik Jan de Wit --- .../keycloak.v2/login/login-username.ftl | 22 +--- .../theme/keycloak.v2/login/login.ftl | 104 +----------------- .../keycloak.v2/login/social-providers.ftl | 104 ++++++++++++++++++ 3 files changed, 109 insertions(+), 121 deletions(-) create mode 100644 themes/src/main/resources/theme/keycloak.v2/login/social-providers.ftl diff --git a/themes/src/main/resources/theme/keycloak.v2/login/login-username.ftl b/themes/src/main/resources/theme/keycloak.v2/login/login-username.ftl index 0652aa31e2..e26b8f9f43 100755 --- a/themes/src/main/resources/theme/keycloak.v2/login/login-username.ftl +++ b/themes/src/main/resources/theme/keycloak.v2/login/login-username.ftl @@ -1,6 +1,7 @@ <#import "template.ftl" as layout> <#import "field.ftl" as field> <#import "buttons.ftl" as buttons> +<#import "social-providers.ftl" as identityProviders> <@layout.registrationLayout displayMessage=!messagesPerField.existsError('username') displayInfo=(realm.password && realm.registrationAllowed && !registrationDisabled??); section> @@ -46,25 +47,8 @@ <#elseif section = "socialProviders" > - <#if realm.password && social?? && social.providers?has_content> -
-
-

${msg("identity-provider-login-label")}

- - -
+ <#if realm.password && social.providers?? && social.providers?has_content> + <@identityProviders.show social=social /> diff --git a/themes/src/main/resources/theme/keycloak.v2/login/login.ftl b/themes/src/main/resources/theme/keycloak.v2/login/login.ftl index 100b1107c8..de456eee24 100755 --- a/themes/src/main/resources/theme/keycloak.v2/login/login.ftl +++ b/themes/src/main/resources/theme/keycloak.v2/login/login.ftl @@ -1,6 +1,7 @@ <#import "template.ftl" as layout> <#import "field.ftl" as field> <#import "buttons.ftl" as buttons> +<#import "social-providers.ftl" as identityProviders> <@layout.registrationLayout displayMessage=!messagesPerField.existsError('username','password') displayInfo=realm.password && realm.registrationAllowed && !registrationDisabled??; section> @@ -42,108 +43,7 @@ <#elseif section = "socialProviders" > <#if realm.password && social.providers?? && social.providers?has_content> - - + <@identityProviders.show social=social/> diff --git a/themes/src/main/resources/theme/keycloak.v2/login/social-providers.ftl b/themes/src/main/resources/theme/keycloak.v2/login/social-providers.ftl new file mode 100644 index 0000000000..5bdd04ba75 --- /dev/null +++ b/themes/src/main/resources/theme/keycloak.v2/login/social-providers.ftl @@ -0,0 +1,104 @@ +<#macro show social> + + + \ No newline at end of file