From 6f155c7a69971e3550bc2b79afdeecf69fc6cd20 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 6 Sep 2021 19:00:00 +0700 Subject: [PATCH] feat: add login idp pages (#1) Co-authored-by: Anthony Lukin --- .../keywind/login/login-idp-link-confirm.ftl | 21 ++++++ theme/keywind/login/login-update-password.ftl | 53 ++++++++++++++ theme/keywind/login/login-update-profile.ftl | 71 +++++++++++++++++++ theme/keywind/login/login.ftl | 20 +++--- 4 files changed, 155 insertions(+), 10 deletions(-) create mode 100644 theme/keywind/login/login-idp-link-confirm.ftl create mode 100644 theme/keywind/login/login-update-password.ftl create mode 100644 theme/keywind/login/login-update-profile.ftl diff --git a/theme/keywind/login/login-idp-link-confirm.ftl b/theme/keywind/login/login-idp-link-confirm.ftl new file mode 100644 index 0000000..5f7923e --- /dev/null +++ b/theme/keywind/login/login-idp-link-confirm.ftl @@ -0,0 +1,21 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> + +<@layout.registrationLayout; section> + <#if section="header"> + ${msg("confirmLinkIdpTitle")} + <#elseif section="form"> +
+
+ <@buttonPrimary.kw name="submitAction" type="submit" value="updateProfile"> + ${msg("confirmLinkIdpReviewProfile")} + +
+
+ <@buttonPrimary.kw name="submitAction" type="submit" value="linkAccount"> + ${msg("confirmLinkIdpContinue", idpDisplayName)} + +
+
+ + diff --git a/theme/keywind/login/login-update-password.ftl b/theme/keywind/login/login-update-password.ftl new file mode 100644 index 0000000..84d3037 --- /dev/null +++ b/theme/keywind/login/login-update-password.ftl @@ -0,0 +1,53 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> +<#import "components/input/primary.ftl" as inputPrimary> + +<@layout.registrationLayout + displayMessage=!messagesPerField.existsError("password", "password-confirm") + ; + section +> + <#if section="header"> + ${msg("updatePasswordTitle")} + <#elseif section="form"> +
+ + +
+ <@inputPrimary.kw + autocomplete="new-password" + autofocus=true + invalid=["password", "password-confirm"] + message=false + name="password-new" + type="password" + > + ${msg("passwordNew")} + +
+
+ <@inputPrimary.kw + autocomplete="new-password" + invalid=["password-confirm"] + name="password-confirm" + type="password" + > + ${msg("passwordConfirm")} + +
+ + <#-- TODO isAppInitiatedAction --> + +
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ + diff --git a/theme/keywind/login/login-update-profile.ftl b/theme/keywind/login/login-update-profile.ftl new file mode 100644 index 0000000..6c538e9 --- /dev/null +++ b/theme/keywind/login/login-update-profile.ftl @@ -0,0 +1,71 @@ +<#import "template.ftl" as layout> +<#import "components/button/primary.ftl" as buttonPrimary> +<#import "components/input/primary.ftl" as inputPrimary> + +<@layout.registrationLayout + displayMessage=!messagesPerField.existsError("email", "firstName", "lastName", "username") + ; + section +> + <#if section="header"> + ${msg("loginProfileTitle")} + <#elseif section="form"> +
+ <#if user.editUsernameAllowed> +
+ <@inputPrimary.kw + autocomplete="username" + autofocus=true + invalid=["username"] + name="username" + type="text" + value=(user.username)!'' + > + ${msg("username")} + +
+ +
+ <@inputPrimary.kw + autocomplete="email" + invalid=["email"] + name="email" + type="email" + value=(user.email)!'' + > + ${msg("email")} + +
+
+ <@inputPrimary.kw + autocomplete="given-name" + invalid=["firstName"] + name="firstName" + type="text" + value=(user.firstName)!'' + > + ${msg("firstName")} + +
+
+ <@inputPrimary.kw + autocomplete="family-name" + invalid=["lastName"] + name="lastName" + type="text" + value=(user.lastName)!'' + > + ${msg("lastName")} + +
+ + <#-- TODO isAppInitiatedAction --> + +
+ <@buttonPrimary.kw type="submit"> + ${msg("doSubmit")} + +
+
+ + diff --git a/theme/keywind/login/login.ftl b/theme/keywind/login/login.ftl index c704742..9b02754 100644 --- a/theme/keywind/login/login.ftl +++ b/theme/keywind/login/login.ftl @@ -51,16 +51,16 @@
- <#if realm.rememberMe && !usernameEditDisabled??> - <@checkboxPrimary.kw checked=login.rememberMe?? name="rememberMe"> - ${msg("rememberMe")} - - - <#if realm.resetPasswordAllowed> - <@linkPrimary.kw href=url.loginResetCredentialsUrl> - ${msg("doForgotPassword")} - - + <#if realm.rememberMe && !usernameEditDisabled??> + <@checkboxPrimary.kw checked=login.rememberMe?? name="rememberMe"> + ${msg("rememberMe")} + + + <#if realm.resetPasswordAllowed> + <@linkPrimary.kw href=url.loginResetCredentialsUrl> + ${msg("doForgotPassword")} + +
<@buttonPrimary.kw name="login" type="submit">