From 8363611adae78ca19c9dacc75c4d1b4172145715 Mon Sep 17 00:00:00 2001 From: siddhantCodes Date: Wed, 28 Aug 2024 17:33:06 +0530 Subject: [PATCH] Indicate that we support either username or email Param `username` of `actions/authenticate-user` and `actions/user/recover-password` is renamed to `username_or_email`. The UI pages (signing and forgot-password) also say "Username or email address" for the form field. --- actions/authenticate-user.ftd | 6 +++--- actions/user/recover-password.ftd | 6 +++--- pages/forgot-password.ftd | 32 +++++++++++++++---------------- pages/signin.ftd | 32 +++++++++++++++---------------- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/actions/authenticate-user.ftd b/actions/authenticate-user.ftd index 63b942d0..fbb6e2a0 100644 --- a/actions/authenticate-user.ftd +++ b/actions/authenticate-user.ftd @@ -1,10 +1,10 @@ --- ftd.string-field $username: username +-- ftd.string-field $username-or-email: username-or-email -- ftd.string-field $password: password -- ftd.string-field $next: next value: / --- void submit-values(username, password, next): -ftd.string-field $username: +-- void submit-values(username_or_email, password, next): +ftd.string-field $username_or_email: ftd.string-field $password: ftd.string-field $next: js: $assets.files.assets.functions.js diff --git a/actions/user/recover-password.ftd b/actions/user/recover-password.ftd index ff38b962..acc80e8b 100644 --- a/actions/user/recover-password.ftd +++ b/actions/user/recover-password.ftd @@ -1,4 +1,4 @@ --- ftd.string-field $username: username +-- ftd.string-field $username-or-email: username-or-email -- ftd.string-field $next: next value: /forgot-password-success/ @@ -8,8 +8,8 @@ value: /forgot-password-success/ value: /set-password/ --- void submit-values(username): -string username: +-- void submit-values(username_or_email): +ftd.string-field username_or_email: ftd.string-field next: $next ftd.string-field set_password_route: $set-password-route js: $assets.files.assets.functions.js diff --git a/pages/forgot-password.ftd b/pages/forgot-password.ftd index 059e7c55..b1a62777 100644 --- a/pages/forgot-password.ftd +++ b/pages/forgot-password.ftd @@ -44,31 +44,31 @@ module action: recover-password spacing: $ds.spaces.vertical-gap.extra-extra-small align-content: left - -- ds.copy-small: Username + -- ds.copy-small: Username or email address -- ftd.text-input: - placeholder: Enter username or email + placeholder: Enter username or email address type: text - $on-input$: $ftd.set-string($a = $page.action.username.value, v = $VALUE) - $on-input$: $utils.set-null($var = $page.action.username.error) + $on-input$: $ftd.set-string($a = $page.action.username-or-email.value, v = $VALUE) + $on-input$: $utils.set-null($var = $page.action.username-or-email.error) width: fill-container height.fixed.px: 40 border-radius.px: 8 background.solid: transparent border-width.px: 1 border-color: $inherited.colors.border - border-color if { page.action.username.error != NULL }: $inherited.colors.error.border + border-color if { page.action.username-or-email.error != NULL }: $inherited.colors.error.border padding.px: 8 color: $inherited.colors.text-strong - -- ds.copy-small: $page.action.username.error - if: { page.action.username.error != NULL } + -- ds.copy-small: $page.action.username-or-email.error + if: { page.action.username-or-email.error != NULL } color: $ds.colors.error.text -- end: ds.column -- ds.primary-button: Send Reset Link - $on-click$: $page.action.submit-values(username = $page.action.username) + $on-click$: $page.action.submit-values(username_or_email = $page.action.username-or-email) width: full radius: curved @@ -122,31 +122,31 @@ module action: recover-password spacing: $ds.spaces.vertical-gap.extra-extra-small align-content: left - -- ds.copy-small: Username + -- ds.copy-small: Username or email address -- ftd.text-input: - placeholder: Enter username or email + placeholder: Enter username or email address type: text - $on-input$: $ftd.set-string($a = $page.action.username.value, v = $VALUE) - $on-input$: $utils.set-null($var = $page.action.username.error) + $on-input$: $ftd.set-string($a = $page.action.username-or-email.value, v = $VALUE) + $on-input$: $utils.set-null($var = $page.action.username-or-email.error) width: fill-container height.fixed.px: 40 border-radius.px: 8 background.solid: transparent border-width.px: 1 border-color: $inherited.colors.border - border-color if { page.action.username.error != NULL }: $inherited.colors.error.border + border-color if { page.action.username-or-email.error != NULL }: $inherited.colors.error.border padding.px: 8 color: $inherited.colors.text-strong - -- ds.copy-small: $page.action.username.error - if: { page.action.username.error != NULL } + -- ds.copy-small: $page.action.username-or-email.error + if: { page.action.username-or-email.error != NULL } color: $ds.colors.error.text -- end: ds.column -- ds.primary-button: Send Reset Link - $on-click$: $page.action.submit-values(username = $page.action.username) + $on-click$: $page.action.submit-values(username_or_email = $page.action.username-or-email) width: full radius: curved diff --git a/pages/signin.ftd b/pages/signin.ftd index 9cc69fe6..9e88f53c 100644 --- a/pages/signin.ftd +++ b/pages/signin.ftd @@ -46,25 +46,25 @@ module authenticate-user: authenticate-user spacing: $ds.spaces.vertical-gap.extra-extra-small align-content: left - -- ds.copy-small: Username + -- ds.copy-small: Username or email address -- ftd.text-input: - placeholder: Enter username + placeholder: Enter username or email address type: text - $on-input$: $ftd.set-string($a = $page.authenticate-user.username.value, v = $VALUE) - $on-input$: $utils.set-null($var = $page.authenticate-user.username.error) + $on-input$: $ftd.set-string($a = $page.authenticate-user.username-or-email.value, v = $VALUE) + $on-input$: $utils.set-null($var = $page.authenticate-user.username-or-email.error) width: fill-container height.fixed.px: 40 border-radius.px: 8 background.solid: transparent border-width.px: 1 border-color: $inherited.colors.border - border-color if { page.authenticate-user.username.error != NULL }: $inherited.colors.error.border + border-color if { page.authenticate-user.username-or-email.error != NULL }: $inherited.colors.error.border padding.px: 8 color: $inherited.colors.text-strong - -- ds.copy-small: $page.authenticate-user.username.error - if: { page.authenticate-user.username.error != NULL } + -- ds.copy-small: $page.authenticate-user.username-or-email.error + if: { page.authenticate-user.username-or-email.error != NULL } color: $ds.colors.error.text -- end: ds.column @@ -97,7 +97,7 @@ module authenticate-user: authenticate-user -- end: ds.column -- ds.primary-button: Login - $on-click$: $page.authenticate-user.submit-values($username=$page.authenticate-user.username, $password=$page.authenticate-user.password, $next=$page.authenticate-user.next) + $on-click$: $page.authenticate-user.submit-values($username_or_email=$page.authenticate-user.username-or-email, $password=$page.authenticate-user.password, $next=$page.authenticate-user.next) width: full radius: curved @@ -162,25 +162,25 @@ module authenticate-user: authenticate-user spacing: $ds.spaces.vertical-gap.extra-extra-small align-content: left - -- ds.copy-small: Username + -- ds.copy-small: Username or email address -- ftd.text-input: - placeholder: Enter username + placeholder: Enter username or email address type: text - $on-input$: $ftd.set-string($a = $page.authenticate-user.username.value, v = $VALUE) - $on-input$: $utils.set-null($var = $page.authenticate-user.username.error) + $on-input$: $ftd.set-string($a = $page.authenticate-user.username-or-email.value, v = $VALUE) + $on-input$: $utils.set-null($var = $page.authenticate-user.username-or-email.error) width: fill-container height.fixed.px: 40 border-radius.px: 8 background.solid: transparent border-width.px: 1 border-color: $inherited.colors.border - border-color if { page.authenticate-user.username.error != NULL }: $inherited.colors.error.border + border-color if { page.authenticate-user.username-or-email.error != NULL }: $inherited.colors.error.border padding.px: 8 color: $inherited.colors.text-strong - -- ds.copy-small: $page.authenticate-user.username.error - if: { page.authenticate-user.username.error != NULL } + -- ds.copy-small: $page.authenticate-user.username-or-email.error + if: { page.authenticate-user.username-or-email.error != NULL } color: $ds.colors.error.text -- end: ds.column @@ -213,7 +213,7 @@ module authenticate-user: authenticate-user -- end: ds.column -- ds.primary-button: Login - $on-click$: $page.authenticate-user.submit-values($username=$page.authenticate-user.username, $password=$page.authenticate-user.password, $next=$page.authenticate-user.next) + $on-click$: $page.authenticate-user.submit-values($username_or_email=$page.authenticate-user.username-or-email, $password=$page.authenticate-user.password, $next=$page.authenticate-user.next) width: full radius: curved