mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-27 03:31:46 +00:00
removed unnecessary 'token' cookie
This commit is contained in:
parent
c4dd6ed19a
commit
6533c8274b
2 changed files with 8 additions and 23 deletions
|
|
@ -41,10 +41,13 @@ class Auth {
|
|||
async authMiddleware(req, res, next) {
|
||||
let token = null;
|
||||
if (req.isAuthenticated && req.isAuthenticated()) {
|
||||
token = req.cookies["token"]
|
||||
const user = await this.verifyToken(token)
|
||||
if (!req.user) {
|
||||
Logger.error('Failed to find user object on request')
|
||||
return res.sendStatus(403)
|
||||
}
|
||||
const user = this.db.users.find(u => u.id === req.user.userId)
|
||||
if (!user) {
|
||||
Logger.error('Verify Token User Not Found', token)
|
||||
Logger.error(`User Not Found, id=${req.user.userId}`)
|
||||
return res.sendStatus(404)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue