diff --git a/CHANGELOG.md b/CHANGELOG.md
index 030c8593..c498ac34 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- In Notes add link to the note author's profile page
- In Moderation log add link to the actor's profile page
- Support pagination of local emoji packs and files
-- Adds MRF Activity Expiration setting
+- Add MRF Activity Expiration setting
+- Add ability to disable multi-factor authentication for a user
### Changed
diff --git a/src/api/users.js b/src/api/users.js
index 642dd1a7..b62df5d7 100644
--- a/src/api/users.js
+++ b/src/api/users.js
@@ -62,6 +62,16 @@ export async function deleteUsers(nicknames, authHost, token) {
})
}
+export async function disableMfa(nickname, authHost, token) {
+ return await request({
+ baseURL: baseName(authHost),
+ url: `/api/pleroma/admin/users/disable_mfa`,
+ method: 'put',
+ headers: authHeaders(token),
+ data: { nickname }
+ })
+}
+
export async function fetchUser(id, authHost, token) {
return await request({
baseURL: baseName(authHost),
diff --git a/src/lang/en.js b/src/lang/en.js
index 16ff35f2..4e1be13b 100644
--- a/src/lang/en.js
+++ b/src/lang/en.js
@@ -201,6 +201,7 @@ export default {
disableAnySubscription: 'Disallow following user at all',
disableAnySubscriptionForMultiple: 'Disallow following users at all',
requirePasswordReset: 'Require password reset on next login',
+ disableMfa: 'Disable multi-factor authentication',
selectUsers: 'Select users to apply actions to multiple users',
moderateUser: 'Moderate user',
moderateUsers: 'Moderate multiple users',
diff --git a/src/store/modules/users.js b/src/store/modules/users.js
index 90b37e56..5f35bf44 100644
--- a/src/store/modules/users.js
+++ b/src/store/modules/users.js
@@ -7,6 +7,7 @@ import {
deactivateUsers,
deleteRight,
deleteUsers,
+ disableMfa,
fetchUsers,
getPasswordResetToken,
searchUsers,
@@ -150,6 +151,14 @@ const users = {
dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId })
},
+ async DisableMfa({ dispatch, getters }, nickname) {
+ try {
+ await disableMfa(nickname, getters.authHost, getters.token)
+ } catch (_e) {
+ return
+ }
+ dispatch('SuccessMessage')
+ },
async ConfirmUsersEmail({ dispatch, getters }, { users, _userId, _statusId }) {
const updatedUsers = users.map(user => {
return { ...user, confirmation_pending: false }
diff --git a/src/views/statuses/show.vue b/src/views/statuses/show.vue
index fc91fcb9..5f13348a 100644
--- a/src/views/statuses/show.vue
+++ b/src/views/statuses/show.vue
@@ -35,7 +35,7 @@
{{ $t('users.requirePasswordReset') }}
+
+ {{ $t('users.disableMfa') }}
+
@@ -127,6 +132,9 @@ export default {
}
},
methods: {
+ disableMfa(nickname) {
+ this.$store.dispatch('DisableMfa', nickname)
+ },
getPasswordResetToken(nickname) {
this.$emit('open-reset-token-dialog')
this.$store.dispatch('GetPasswordResetToken', nickname)