mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 23:02:50 +02:00
Add in-memory user cache
This commit is contained in:
+10
-20
@@ -990,28 +990,18 @@ class Auth {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Database.userModel
|
||||
.update(
|
||||
{
|
||||
pash: pw
|
||||
},
|
||||
{
|
||||
where: { id: matchingUser.id }
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
Logger.info(`[Auth] User "${matchingUser.username}" changed password`)
|
||||
res.json({
|
||||
success: true
|
||||
})
|
||||
try {
|
||||
await matchingUser.update({ pash: pw })
|
||||
Logger.info(`[Auth] User "${matchingUser.username}" changed password`)
|
||||
res.json({
|
||||
success: true
|
||||
})
|
||||
.catch((error) => {
|
||||
Logger.error(`[Auth] User "${matchingUser.username}" failed to change password`, error)
|
||||
res.json({
|
||||
error: 'Unknown error'
|
||||
})
|
||||
} catch (error) {
|
||||
Logger.error(`[Auth] User "${matchingUser.username}" failed to change password`, error)
|
||||
res.json({
|
||||
error: 'Unknown error'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user