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({
|
return await request({
|
||||||
baseURL: baseName(authHost),
|
baseURL: baseName(authHost),
|
||||||
url: `/api/pleroma/admin/users/${nickname}/force_password_reset`,
|
url: `/api/pleroma/admin/users/force_password_reset`,
|
||||||
method: 'patch',
|
method: 'patch',
|
||||||
headers: authHeaders(token)
|
headers: authHeaders(token),
|
||||||
|
data: { nicknames }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,9 +240,9 @@ const users = {
|
||||||
}
|
}
|
||||||
dispatch('SuccessMessage')
|
dispatch('SuccessMessage')
|
||||||
},
|
},
|
||||||
async RequirePasswordReset({ dispatch, getters }, user) {
|
async RequirePasswordReset({ dispatch, getters }, { nicknames }) {
|
||||||
try {
|
try {
|
||||||
await requirePasswordReset(user.nickname, getters.authHost, getters.token)
|
await requirePasswordReset(nicknames, getters.authHost, getters.token)
|
||||||
} catch (_e) {
|
} catch (_e) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,8 @@ export default {
|
||||||
},
|
},
|
||||||
requirePasswordReset: () => {
|
requirePasswordReset: () => {
|
||||||
const filtered = this.selectedUsers.filter(user => user.local)
|
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')
|
this.$emit('apply-action')
|
||||||
},
|
},
|
||||||
confirmAccounts: () => {
|
confirmAccounts: () => {
|
||||||
|
|
|
@ -277,7 +277,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$store.dispatch('RequirePasswordReset', { nickname })
|
this.$store.dispatch('RequirePasswordReset', { nicknames: [nickname] })
|
||||||
},
|
},
|
||||||
toggleActivation(user) {
|
toggleActivation(user) {
|
||||||
user.deactivated
|
user.deactivated
|
||||||
|
|
Loading…
Reference in a new issue