initial
This commit is contained in:
23
apps/client/pages/reset-password/email-confirmation.vue
Normal file
23
apps/client/pages/reset-password/email-confirmation.vue
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<AuthorizationEmailConfirmation :email="email" :resend-fn="resend">
|
||||
<div v-html="$t('reset_password_instructions')" />
|
||||
</AuthorizationEmailConfirmation>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
definePageMeta({
|
||||
layout: 'auth',
|
||||
pageTransition: { name: 'fade', mode: 'out-in' },
|
||||
validate: route => !!route.query.email,
|
||||
// middleware: ['guest-only'],
|
||||
})
|
||||
|
||||
const { query } = useRoute()
|
||||
const { requestResetPassword } = useAuth()
|
||||
|
||||
const email = computed(() => query.email!.toString())
|
||||
|
||||
function resend() {
|
||||
requestResetPassword(email.value)
|
||||
}
|
||||
</script>
|
||||
48
apps/client/pages/reset-password/index.vue
Normal file
48
apps/client/pages/reset-password/index.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<PageForm
|
||||
:title="$t('reset_password')"
|
||||
back-link="/login"
|
||||
:back-text="$t('to_main')"
|
||||
:submit-text="$t('next')"
|
||||
:handler="onSubmit"
|
||||
>
|
||||
<UiAlert class="mb-16">
|
||||
{{ $t('reset_password_alert') }}
|
||||
</UiAlert>
|
||||
|
||||
<UiInput id="email" :label="$t('email')" rules="required|email" />
|
||||
</PageForm>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
definePageMeta({
|
||||
layout: 'auth',
|
||||
pageTransition: { name: 'fade', mode: 'out-in' },
|
||||
middleware: ['guest-only'],
|
||||
})
|
||||
|
||||
const { requestResetPassword } = useAuth()
|
||||
|
||||
async function onSubmit(values) {
|
||||
await requestResetPassword(values.email)
|
||||
|
||||
navigateTo({
|
||||
path: '/reset-password/email-confirmation',
|
||||
query: {
|
||||
email: values.email,
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.reset-form {
|
||||
margin: 0 auto;
|
||||
width: 500px;
|
||||
|
||||
&__summary {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 22px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
65
apps/client/pages/reset-password/new-authorized.vue
Normal file
65
apps/client/pages/reset-password/new-authorized.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<PageForm
|
||||
:title="$t('reset_password')"
|
||||
back-link="/settings/safety"
|
||||
:back-text="$t('back')"
|
||||
:submit-text="$t('next')"
|
||||
:handler="onSubmit"
|
||||
:title-offset="false"
|
||||
class="reset-password"
|
||||
>
|
||||
<UiAlert class="mb-40">
|
||||
В целях безопасности будет запрещен вывод средств в течение 24 часов после изменения пароля
|
||||
</UiAlert>
|
||||
|
||||
<UiInput
|
||||
id="current_password"
|
||||
label="Current password"
|
||||
native-type="password"
|
||||
rules="required|password"
|
||||
class="mb-6"
|
||||
autocomplete="off"
|
||||
/>
|
||||
|
||||
<UiInput
|
||||
id="new_password"
|
||||
:label="$t('password')"
|
||||
native-type="password"
|
||||
rules="required|password"
|
||||
class="mb-6"
|
||||
/>
|
||||
|
||||
<UiInput
|
||||
id="repeat_password"
|
||||
:label="$t('repeat_password')"
|
||||
native-type="password"
|
||||
rules="required|confirmed:@new_password"
|
||||
/>
|
||||
</PageForm>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
definePageMeta({
|
||||
pageTransition: { name: 'fade', mode: 'out-in' },
|
||||
centerContent: true,
|
||||
middleware: ['auth'],
|
||||
})
|
||||
|
||||
const { resetPassword } = useAuth()
|
||||
const { query } = useRoute()
|
||||
|
||||
async function onSubmit(values) {
|
||||
try {
|
||||
await resetPassword(values.new_password, query.reset_code.toString())
|
||||
|
||||
navigateTo('/settings/safety')
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.reset-password {
|
||||
--page-form-padding-top: 8px;
|
||||
}
|
||||
</style>
|
||||
57
apps/client/pages/reset-password/new.vue
Normal file
57
apps/client/pages/reset-password/new.vue
Normal file
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<PageForm
|
||||
:title="$t('reset_password')"
|
||||
back-link="/login"
|
||||
:back-text="$t('back')"
|
||||
:submit-text="$t('next')"
|
||||
:handler="onSubmit"
|
||||
>
|
||||
<UiInput
|
||||
id="new_password"
|
||||
:label="$t('password')"
|
||||
native-type="password"
|
||||
rules="required|password"
|
||||
class="mb-6"
|
||||
/>
|
||||
|
||||
<UiInput
|
||||
id="repeat_password"
|
||||
:label="$t('repeat_password')"
|
||||
native-type="password"
|
||||
rules="required|confirmed:@new_password"
|
||||
/>
|
||||
</PageForm>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
definePageMeta({
|
||||
layout: 'auth',
|
||||
pageTransition: { name: 'fade', mode: 'out-in' },
|
||||
validate: route => !!route.query.reset_code,
|
||||
middleware: ['guest-only'],
|
||||
})
|
||||
|
||||
const { resetPassword } = useAuth()
|
||||
const { query } = useRoute()
|
||||
|
||||
async function onSubmit(values) {
|
||||
try {
|
||||
await resetPassword(values.new_password, query.reset_code.toString())
|
||||
|
||||
navigateTo('/login')
|
||||
}
|
||||
catch {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.reset-form {
|
||||
margin: 0 auto;
|
||||
width: 500px;
|
||||
|
||||
&__summary {
|
||||
padding-top: 24px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user