2021-05-04 01:05:34 -05:00
|
|
|
<template>
|
2022-06-20 03:38:49 -05:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 02:20:53 -05:00
|
|
|
<MkSpacer v-if="token" :contentMax="700" :marginMin="16" :marginMax="32">
|
2023-01-05 22:40:17 -06:00
|
|
|
<div class="_gaps_m">
|
2023-01-07 00:09:46 -06:00
|
|
|
<MkInput v-model="password" type="password">
|
2022-12-19 04:01:30 -06:00
|
|
|
<template #prefix><i class="ti ti-lock"></i></template>
|
2022-06-20 03:38:49 -05:00
|
|
|
<template #label>{{ i18n.ts.newPassword }}</template>
|
2023-01-07 00:09:46 -06:00
|
|
|
</MkInput>
|
2023-07-07 17:08:16 -05:00
|
|
|
|
2023-01-05 18:41:14 -06:00
|
|
|
<MkButton primary @click="save">{{ i18n.ts.save }}</MkButton>
|
2022-06-20 03:38:49 -05:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2021-05-04 01:05:34 -05:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 20:02:27 -06:00
|
|
|
<script lang="ts" setup>
|
2022-05-01 08:51:07 -05:00
|
|
|
import { defineAsyncComponent, onMounted } from 'vue';
|
2023-01-07 00:09:46 -06:00
|
|
|
import MkInput from '@/components/MkInput.vue';
|
2023-01-05 18:41:14 -06:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2021-11-11 11:02:25 -06:00
|
|
|
import * as os from '@/os';
|
2022-01-15 20:02:27 -06:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 03:38:49 -05:00
|
|
|
import { mainRouter } from '@/router';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2022-01-15 20:02:27 -06:00
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
token?: string;
|
|
|
|
}>();
|
|
|
|
|
|
|
|
let password = $ref('');
|
|
|
|
|
|
|
|
async function save() {
|
|
|
|
await os.apiWithDialog('reset-password', {
|
|
|
|
token: props.token,
|
|
|
|
password: password,
|
|
|
|
});
|
2022-06-20 03:38:49 -05:00
|
|
|
mainRouter.push('/');
|
2022-01-15 20:02:27 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (props.token == null) {
|
2022-08-30 10:24:33 -05:00
|
|
|
os.popup(defineAsyncComponent(() => import('@/components/MkForgotPassword.vue')), {}, {}, 'closed');
|
2022-06-20 03:38:49 -05:00
|
|
|
mainRouter.push('/');
|
2022-01-15 20:02:27 -06:00
|
|
|
}
|
|
|
|
});
|
2021-05-04 01:05:34 -05:00
|
|
|
|
2022-06-20 03:38:49 -05:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.resetPassword,
|
2022-12-19 04:01:30 -06:00
|
|
|
icon: 'ti ti-lock',
|
2021-05-04 01:05:34 -05:00
|
|
|
});
|
|
|
|
</script>
|