From b10aa7424b108259a4010617ac439e41dfa2283e Mon Sep 17 00:00:00 2001 From: Birte Driehaus <47067241+MorennMcFly@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:54:14 +0200 Subject: [PATCH] Feature/bus 928 password reset (#56) * [BUS-928] reset password flow * [BUS-928] fix problem resulting from merge conflict * [BUS-928] code review changes --- components/Account/AccountLogin.vue | 24 ++++++- .../Account/AccountLoginRegisterTabs.vue | 9 ++- components/Account/AccountRecoverPassword.vue | 71 +++++++++++++++++++ components/Account/AccountResetPassword.vue | 62 ++++++++++++++++ .../Layout/Header/LayoutHeaderAccount.vue | 8 ++- composables/usePasswordRecovery.ts | 29 ++++++++ composables/useStaticBreadcrumbs.ts | 17 ++++- i18n/de-DE/account.json | 22 +++++- i18n/de-DE/composable.json | 3 +- i18n/en-GB/account.json | 21 +++++- i18n/en-GB/composable.json | 3 +- pages/account/recover/index.vue | 13 ++++ pages/account/recover/password.vue | 13 ++++ stores/CustomerStore.ts | 5 ++ 14 files changed, 289 insertions(+), 11 deletions(-) create mode 100644 components/Account/AccountRecoverPassword.vue create mode 100644 components/Account/AccountResetPassword.vue create mode 100644 composables/usePasswordRecovery.ts create mode 100644 pages/account/recover/index.vue create mode 100644 pages/account/recover/password.vue diff --git a/components/Account/AccountLogin.vue b/components/Account/AccountLogin.vue index 8399df6b..7ebca0da 100644 --- a/components/Account/AccountLogin.vue +++ b/components/Account/AccountLogin.vue @@ -12,14 +12,18 @@ const props = withDefaults( redirectAfterSuccess?: boolean; redirectTarget?: string; showCreateLink?: boolean; + showRecoverLink?: boolean; }>(), { redirectAfterSuccess: false, redirectTarget: '/account', showCreateLink: true, + showRecoverLink: true, }, ); +defineEmits(['closeModal']); + const customerStore = useCustomerStore(); const { togglePasswordVisibility } = useFormkitHelper(); const { resolveApiErrors } = useApiErrorsResolver(); @@ -91,11 +95,25 @@ const handleLogin = async (fields: FormkitLoginFields) => { suffix-icon="lock" @suffix-icon-click="togglePasswordVisibility" /> + +
{{ $t('account.login.createAccount') }} - + {{ $t('account.login.createAccountLink') }} + + + + {{ $t('account.login.recoverPasswordLink') }} + +
diff --git a/components/Account/AccountLoginRegisterTabs.vue b/components/Account/AccountLoginRegisterTabs.vue index 62b364b1..98d33b2f 100644 --- a/components/Account/AccountLoginRegisterTabs.vue +++ b/components/Account/AccountLoginRegisterTabs.vue @@ -1,3 +1,7 @@ + +