2021-05-04 08:05:34 +02:00
|
|
|
<template>
|
2022-01-02 13:35:23 +01:00
|
|
|
<MkSpacer v-if="token" :content-max="700" :margin-min="16" :margin-max="32">
|
|
|
|
<div class="_formRoot">
|
|
|
|
<FormInput v-model="password" type="password" class="_formBlock">
|
|
|
|
<template #prefix><i class="fas fa-lock"></i></template>
|
|
|
|
<template #label>{{ $ts.newPassword }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
|
|
|
<FormButton primary class="_formBlock" @click="save">{{ $ts.save }}</FormButton>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
2021-05-04 08:05:34 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2022-01-02 13:35:23 +01:00
|
|
|
import FormInput from '@/components/form/input.vue';
|
|
|
|
import FormButton from '@/components/ui/button.vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
2021-05-04 08:05:34 +02:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormInput,
|
|
|
|
FormButton,
|
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
token: {
|
|
|
|
type: String,
|
|
|
|
required: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.resetPassword,
|
2022-01-02 13:35:23 +01:00
|
|
|
icon: 'fas fa-lock',
|
|
|
|
bg: 'var(--bg)',
|
2021-05-04 08:05:34 +02:00
|
|
|
},
|
|
|
|
password: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
if (this.token == null) {
|
2021-11-11 18:02:25 +01:00
|
|
|
os.popup(import('@/components/forgot-password.vue'), {}, {}, 'closed');
|
2021-05-04 08:05:34 +02:00
|
|
|
this.$router.push('/');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
async save() {
|
|
|
|
await os.apiWithDialog('reset-password', {
|
|
|
|
token: this.token,
|
|
|
|
password: this.password,
|
|
|
|
});
|
|
|
|
this.$router.push('/');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
|
|
</style>
|