Commit 67bffe28 authored by Eugenij's avatar Eugenij
Browse files

Password reset fix

parent fd02cc75
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment