From 4215a11d9a6be81386c024771f4a170bc8c82611 Mon Sep 17 00:00:00 2001 From: atsuchan <83960488+atsu1125@users.noreply.github.com> Date: Sun, 12 Mar 2023 16:44:41 +0900 Subject: パスワードリセットがおささってしまわないようにする (#10304) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add dialog to Password reset --- packages/frontend/src/pages/user-info.vue | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'packages/frontend/src') diff --git a/packages/frontend/src/pages/user-info.vue b/packages/frontend/src/pages/user-info.vue index 373af193d7..571f058240 100644 --- a/packages/frontend/src/pages/user-info.vue +++ b/packages/frontend/src/pages/user-info.vue @@ -262,14 +262,21 @@ async function updateRemoteUser() { } async function resetPassword() { - const { password } = await os.api('admin/reset-password', { - userId: user.id, - }); - - os.alert({ - type: 'success', - text: i18n.t('newPasswordIs', { password }), + const confirm = await os.confirm({ + type: 'warning', + text: i18n.ts.resetPasswordConfirm, }); + if (confirm.canceled) { + return; + } else { + const { password } = await os.api('admin/reset-password', { + userId: user.id, + }); + os.alert({ + type: 'success', + text: i18n.t('newPasswordIs', { password }), + }); + } } async function toggleSuspend(v) { -- cgit v1.3.1-freya