mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 19:31:39 +00:00
Fix: root user cannot be edited
This commit is contained in:
parent
48f232790a
commit
c1377a8666
1 changed files with 4 additions and 1 deletions
|
|
@ -226,7 +226,10 @@ class UserController {
|
|||
return res.status(400).send('Invalid username')
|
||||
}
|
||||
if (updatePayload.type && !Database.userModel.accountTypes.includes(updatePayload.type)) {
|
||||
return res.status(400).send('Invalid account type')
|
||||
// Root user is not included in the OAuth account types so it cannot be overwritten
|
||||
if (updatePayload.type !== 'root') {
|
||||
return res.status(400).send('Invalid account type')
|
||||
}
|
||||
}
|
||||
if (updatePayload.permissions && typeof updatePayload.permissions !== 'object') {
|
||||
return res.status(400).send('Invalid permissions')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue