From 17f81d2332a1a1de15effc0a4cff381d1c8dbedf Mon Sep 17 00:00:00 2001 From: Anthony Kinsey Date: Thu, 10 Feb 2022 14:29:00 -1000 Subject: [PATCH] feat: implement reset password functionality for admins, still need to port reset password view --- src/views/Profile.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/views/Profile.vue b/src/views/Profile.vue index cb4479a5..515fb0f8 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -142,7 +142,7 @@
Deactivate Account @@ -310,6 +310,10 @@ export default { .then(() => $alertStore.success(`${v.user.ignore_messages ? 'Ignoring' : 'Unignoring' } messages from ${v.user.username}`)) } + const resetPassword = () => usersApi.adminRecover({ user_id: v.user.id }) + .then(() => $alertStore.success('Password Reset Email Sent')) + .catch(() => $alertStore.error('Error resetting password')) + /* Internal Data */ const $router = useRouter() const $auth = inject(AuthStore) @@ -336,7 +340,7 @@ export default { showDelete: false, showManageBans: false }) - return { ...toRefs(v), refreshUser, banExpiration, toggleIgnorePosts, toggleIgnoreMessages, toggleIgnoreMentions, redirectHome, canUpdate, canUpdateUsername, canMessage, userAge, canUpdatePrivate, pageOwner, canPageUserNotes, canBanUser, canBoardBanUser, canReactivate, canReset, canDeactivate, canDelete, humanDate } + return { ...toRefs(v), refreshUser, banExpiration, toggleIgnorePosts, toggleIgnoreMessages, toggleIgnoreMentions, redirectHome, canUpdate, canUpdateUsername, canMessage, userAge, canUpdatePrivate, pageOwner, canPageUserNotes, canBanUser, canBoardBanUser, canReactivate, canReset, canDeactivate, canDelete, resetPassword, humanDate } } }