summaryrefslogtreecommitdiff
path: root/src/client/components
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2020-01-31 05:15:59 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2020-01-31 05:15:59 +0900
commit635afdf53f4383cbc02ce1eed9bd35590fb33978 (patch)
treef8a046f4499f2431b8345ecc9f6c46c17cb4a910 /src/client/components
parentShow moderator badge (diff)
downloadmisskey-635afdf53f4383cbc02ce1eed9bd35590fb33978.tar.gz
misskey-635afdf53f4383cbc02ce1eed9bd35590fb33978.tar.bz2
misskey-635afdf53f4383cbc02ce1eed9bd35590fb33978.zip
Fix password reset
Diffstat (limited to 'src/client/components')
-rw-r--r--src/client/components/user-moderate-dialog.vue19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/client/components/user-moderate-dialog.vue b/src/client/components/user-moderate-dialog.vue
index 46915b2e9e..f45342564c 100644
--- a/src/client/components/user-moderate-dialog.vue
+++ b/src/client/components/user-moderate-dialog.vue
@@ -2,7 +2,7 @@
<x-window @closed="() => { $emit('closed'); destroyDom(); }" :avatar="user">
<template #header><mk-user-name :user="user"/></template>
<div class="vrcsvlkm">
- <mk-button @click="changePassword()">{{ $t('changePassword') }}</mk-button>
+ <mk-button @click="resetPassword()" primary>{{ $t('resetPassword') }}</mk-button>
<mk-switch v-if="$store.state.i.isAdmin" @change="toggleModerator()" v-model="moderator">{{ $t('moderator') }}</mk-switch>
<mk-switch @change="toggleSilence()" v-model="silenced">{{ $t('silence') }}</mk-switch>
<mk-switch @change="toggleSuspend()" v-model="suspended">{{ $t('suspend') }}</mk-switch>
@@ -42,27 +42,18 @@ export default Vue.extend({
},
methods: {
- async changePassword() {
- const { canceled: canceled, result: newPassword } = await this.$root.dialog({
- title: this.$t('newPassword'),
- input: {
- type: 'password'
- }
- });
- if (canceled) return;
-
+ async resetPassword() {
const dialog = this.$root.dialog({
type: 'waiting',
iconOnly: true
});
- this.$root.api('admin/change-password', {
+ this.$root.api('admin/reset-password', {
userId: this.user.id,
- newPassword
- }).then(() => {
+ }).then(({ password }) => {
this.$root.dialog({
type: 'success',
- iconOnly: true, autoClose: true
+ text: this.$t('newPasswordIs', { password })
});
}).catch(e => {
this.$root.dialog({