forked from AkkomaGang/admin-fe
Merge branch 'fix-password-reset' into 'develop'
Fix for forced password reset Closes #70 See merge request pleroma/admin-fe!84
This commit is contained in:
commit
ece7485a4c
4 changed files with 9 additions and 7 deletions
|
@ -89,12 +89,13 @@ export async function getPasswordResetToken(nickname, authHost, token) {
|
|||
})
|
||||
}
|
||||
|
||||
export async function requirePasswordReset(nickname, authHost, token) {
|
||||
export async function requirePasswordReset(nicknames, authHost, token) {
|
||||
return await request({
|
||||
baseURL: baseName(authHost),
|
||||
url: `/api/pleroma/admin/users/${nickname}/force_password_reset`,
|
||||
url: `/api/pleroma/admin/users/force_password_reset`,
|
||||
method: 'patch',
|
||||
headers: authHeaders(token)
|
||||
headers: authHeaders(token),
|
||||
data: { nicknames }
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -240,9 +240,9 @@ const users = {
|
|||
}
|
||||
dispatch('SuccessMessage')
|
||||
},
|
||||
async RequirePasswordReset({ dispatch, getters }, user) {
|
||||
async RequirePasswordReset({ dispatch, getters }, { nicknames }) {
|
||||
try {
|
||||
await requirePasswordReset(user.nickname, getters.authHost, getters.token)
|
||||
await requirePasswordReset(nicknames, getters.authHost, getters.token)
|
||||
} catch (_e) {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -216,7 +216,8 @@ export default {
|
|||
},
|
||||
requirePasswordReset: () => {
|
||||
const filtered = this.selectedUsers.filter(user => user.local)
|
||||
filtered.map(user => this.$store.dispatch('RequirePasswordReset', user))
|
||||
const nicknames = filtered.map(u => u.nickname)
|
||||
this.$store.dispatch('RequirePasswordReset', { nicknames })
|
||||
this.$emit('apply-action')
|
||||
},
|
||||
confirmAccounts: () => {
|
||||
|
|
|
@ -277,7 +277,7 @@ export default {
|
|||
return
|
||||
}
|
||||
|
||||
this.$store.dispatch('RequirePasswordReset', { nickname })
|
||||
this.$store.dispatch('RequirePasswordReset', { nicknames: [nickname] })
|
||||
},
|
||||
toggleActivation(user) {
|
||||
user.deactivated
|
||||
|
|
Loading…
Reference in a new issue