2021-10-20 17:38:25 +02:00
|
|
|
<template>
|
2021-11-03 09:10:23 +01:00
|
|
|
<div id="password-reset" class="view">
|
2021-10-20 17:38:25 +02:00
|
|
|
<div class="container">
|
|
|
|
<PasswordResetRequest
|
|
|
|
v-if="action.startsWith('reset')"
|
|
|
|
:action="action"
|
|
|
|
:token="token"
|
|
|
|
/>
|
|
|
|
<PasswordEmailSent v-else :action="action" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed, toRefs, onBeforeMount } from 'vue'
|
2021-10-20 17:38:25 +02:00
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
|
|
|
|
import PasswordEmailSent from '@/components/User/PasswordReset/PasswordActionDone.vue'
|
|
|
|
import PasswordResetRequest from '@/components/User/PasswordReset/PasswordResetForm.vue'
|
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
interface Props {
|
|
|
|
action: string
|
|
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const router = useRouter()
|
2021-10-20 17:38:25 +02:00
|
|
|
|
2021-11-10 21:19:27 +01:00
|
|
|
const { action } = toRefs(props)
|
|
|
|
const token = computed(() => route.query.token)
|
|
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
|
if (props.action === 'reset' && !token.value) {
|
|
|
|
router.push('/')
|
|
|
|
}
|
2021-10-20 17:38:25 +02:00
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-11-29 11:23:21 +01:00
|
|
|
@import '~@/scss/vars.scss';
|
2021-10-20 17:38:25 +02:00
|
|
|
|
|
|
|
#password-reset {
|
|
|
|
display: flex;
|
|
|
|
.container {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
width: 50%;
|
|
|
|
|
|
|
|
@media screen and (max-width: $small-limit) {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|