forked from AkkomaGang/admin-fe
Merge branch 'feature/disable-mfa' into 'develop'
Ability to disable MFA Closes #121 See merge request pleroma/admin-fe!140
This commit is contained in:
commit
866fa29757
6 changed files with 31 additions and 2 deletions
|
@ -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 Notes add link to the note author's profile page
|
||||||
- In Moderation log add link to the actor's profile page
|
- In Moderation log add link to the actor's profile page
|
||||||
- Support pagination of local emoji packs and files
|
- 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
|
### Changed
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
export async function fetchUser(id, authHost, token) {
|
||||||
return await request({
|
return await request({
|
||||||
baseURL: baseName(authHost),
|
baseURL: baseName(authHost),
|
||||||
|
|
|
@ -201,6 +201,7 @@ export default {
|
||||||
disableAnySubscription: 'Disallow following user at all',
|
disableAnySubscription: 'Disallow following user at all',
|
||||||
disableAnySubscriptionForMultiple: 'Disallow following users at all',
|
disableAnySubscriptionForMultiple: 'Disallow following users at all',
|
||||||
requirePasswordReset: 'Require password reset on next login',
|
requirePasswordReset: 'Require password reset on next login',
|
||||||
|
disableMfa: 'Disable multi-factor authentication',
|
||||||
selectUsers: 'Select users to apply actions to multiple users',
|
selectUsers: 'Select users to apply actions to multiple users',
|
||||||
moderateUser: 'Moderate user',
|
moderateUser: 'Moderate user',
|
||||||
moderateUsers: 'Moderate multiple users',
|
moderateUsers: 'Moderate multiple users',
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
deactivateUsers,
|
deactivateUsers,
|
||||||
deleteRight,
|
deleteRight,
|
||||||
deleteUsers,
|
deleteUsers,
|
||||||
|
disableMfa,
|
||||||
fetchUsers,
|
fetchUsers,
|
||||||
getPasswordResetToken,
|
getPasswordResetToken,
|
||||||
searchUsers,
|
searchUsers,
|
||||||
|
@ -150,6 +151,14 @@ const users = {
|
||||||
|
|
||||||
dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId })
|
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 }) {
|
async ConfirmUsersEmail({ dispatch, getters }, { users, _userId, _statusId }) {
|
||||||
const updatedUsers = users.map(user => {
|
const updatedUsers = users.map(user => {
|
||||||
return { ...user, confirmation_pending: false }
|
return { ...user, confirmation_pending: false }
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</header>
|
</header>
|
||||||
<moderation-dropdown
|
<moderation-dropdown
|
||||||
:user="user"
|
:user="user"
|
||||||
:page="'userPage'"
|
:page="'statusPage'"
|
||||||
@open-reset-token-dialog="openResetPasswordDialog"/>
|
@open-reset-token-dialog="openResetPasswordDialog"/>
|
||||||
</div>
|
</div>
|
||||||
<reset-password-dialog
|
<reset-password-dialog
|
||||||
|
|
|
@ -98,6 +98,11 @@
|
||||||
@click.native="requirePasswordReset(user)">
|
@click.native="requirePasswordReset(user)">
|
||||||
{{ $t('users.requirePasswordReset') }}
|
{{ $t('users.requirePasswordReset') }}
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
<el-dropdown-item
|
||||||
|
v-if="user.local"
|
||||||
|
@click.native="disableMfa(user.nickname)">
|
||||||
|
{{ $t('users.disableMfa') }}
|
||||||
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
@ -127,6 +132,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
disableMfa(nickname) {
|
||||||
|
this.$store.dispatch('DisableMfa', nickname)
|
||||||
|
},
|
||||||
getPasswordResetToken(nickname) {
|
getPasswordResetToken(nickname) {
|
||||||
this.$emit('open-reset-token-dialog')
|
this.$emit('open-reset-token-dialog')
|
||||||
this.$store.dispatch('GetPasswordResetToken', nickname)
|
this.$store.dispatch('GetPasswordResetToken', nickname)
|
||||||
|
|
Loading…
Reference in a new issue