Skip to content

Commit

Permalink
fix: (regression beta) admin/accounts: attempting to change password …
Browse files Browse the repository at this point in the history
…to any account was actually applying to the current account
  • Loading branch information
rejetto committed Jan 2, 2024
1 parent 5481581 commit d0bee06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/src/AccountForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function AccountForm({ account, done, groups, addToBar, reload }:
save: {
sx: modifiedSx( !isEqualLax(values, account)),
async onClick() {
const { password='', password2, adminActualAccess, hasPassword, ...withoutPassword } = values
const { password='', password2, adminActualAccess, hasPassword, invalidated, ...withoutPassword } = values
if (add) {
const got = await apiCall('add_account', withoutPassword)
if (password)
Expand All @@ -101,7 +101,7 @@ export default function AccountForm({ account, done, groups, addToBar, reload }:
changes: withoutPassword,
})
if (password)
await apiNewPassword(username, password)
await apiNewPassword(values.username, password)
if (account.username === username)
state.username = values.username
setTimeout(() => toast("Account modified", 'success'), 1) // workaround: showing a dialog at this point is causing a crash if we are in a dialog
Expand Down

0 comments on commit d0bee06

Please sign in to comment.