2023-07-27 14:31:52 +09:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2021-05-04 15:05:34 +09:00
|
|
|
<template>
|
2022-06-20 17:38:49 +09:00
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 16:20:53 +09:00
|
|
|
<MkSpacer v-if="token" :contentMax="700" :marginMin="16" :marginMax="32">
|
2023-01-06 13:40:17 +09:00
|
|
|
<div class="_gaps_m">
|
2023-01-07 15:09:46 +09:00
|
|
|
<MkInput v-model="password" type="password">
|
2023-10-01 04:53:52 +09:00
|
|
|
<template #prefix><i class="ph-lock ph-bold ph-lg"></i></template>
|
2022-06-20 17:38:49 +09:00
|
|
|
<template #label>{{ i18n.ts.newPassword }}</template>
|
2023-01-07 15:09:46 +09:00
|
|
|
</MkInput>
|
2023-07-08 07:08:16 +09:00
|
|
|
|
2023-01-06 09:41:14 +09:00
|
|
|
<MkButton primary @click="save">{{ i18n.ts.save }}</MkButton>
|
2022-06-20 17:38:49 +09:00
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2021-05-04 15:05:34 +09:00
|
|
|
</template>
|
|
|
|
|
2022-01-16 11:02:27 +09:00
|
|
|
<script lang="ts" setup>
|
2022-05-01 22:51:07 +09:00
|
|
|
import { defineAsyncComponent, onMounted } from 'vue';
|
2023-01-07 15:09:46 +09:00
|
|
|
import MkInput from '@/components/MkInput.vue';
|
2023-01-06 09:41:14 +09:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2023-09-19 16:37:43 +09:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { mainRouter } from '@/router.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2022-01-16 11:02:27 +09: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 17:38:49 +09:00
|
|
|
mainRouter.push('/');
|
2022-01-16 11:02:27 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
if (props.token == null) {
|
2022-08-31 00:24:33 +09:00
|
|
|
os.popup(defineAsyncComponent(() => import('@/components/MkForgotPassword.vue')), {}, {}, 'closed');
|
2022-06-20 17:38:49 +09:00
|
|
|
mainRouter.push('/');
|
2022-01-16 11:02:27 +09:00
|
|
|
}
|
|
|
|
});
|
2021-05-04 15:05:34 +09:00
|
|
|
|
2022-06-20 17:38:49 +09:00
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.resetPassword,
|
2023-10-01 04:53:52 +09:00
|
|
|
icon: 'ph-lock ph-bold ph-lg',
|
2021-05-04 15:05:34 +09:00
|
|
|
});
|
|
|
|
</script>
|