mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-12-03 21:54:22 +01:00
Use transaction and check root on server init
This commit is contained in:
1 parent
2a0507ffc6
commit
34715558df
3 files changed
+22
-6
No files matched your search
@@ -189,7 +189,7 @@ class User extends Model {
|
||||
* @param {import('../Auth')} auth
|
||||
* @returns {Promise<User>}
|
||||
*/
|
||||
static async createRootUser(username, pash, auth) {
|
||||
static async createRootUser(username, pash, auth, transaction = null) {
|
||||
const userId = uuidv4()
|
||||
|
||||
const token = auth.generateAccessToken({ id: userId, username })
|
||||
@@ -207,7 +207,7 @@ class User extends Model {
|
||||
seriesHideFromContinueListening: []
|
||||
}
|
||||
}
|
||||
return this.create(newUser)
|
||||
return this.create(newUser, { transaction })
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user