mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-09 13:29:37 +00:00
Add in-memory user cache
This commit is contained in:
parent
2e970cbb39
commit
a382482173
2 changed files with 117 additions and 25 deletions
|
|
@ -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'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue