mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-31 16:24:45 +02:00
Update:Express middleware sets req.user to new data model, openid permissions functions moved to new data model
This commit is contained in:
parent
29a15858f4
commit
2472b86284
29 changed files with 474 additions and 430 deletions
|
@ -91,8 +91,6 @@ class Server {
|
|||
|
||||
/**
|
||||
* Middleware to check if the current request is authenticated
|
||||
* req.user is set if authenticated to the OLD user object
|
||||
* req.userNew is set if authenticated to the NEW user object
|
||||
*
|
||||
* @param {import('express').Request} req
|
||||
* @param {import('express').Response} res
|
||||
|
@ -100,14 +98,7 @@ class Server {
|
|||
*/
|
||||
authMiddleware(req, res, next) {
|
||||
// ask passportjs if the current request is authenticated
|
||||
this.auth.isAuthenticated(req, res, () => {
|
||||
if (req.user) {
|
||||
// TODO: req.userNew to become req.user
|
||||
req.userNew = req.user
|
||||
req.user = Database.userModel.getOldUser(req.user)
|
||||
}
|
||||
next()
|
||||
})
|
||||
this.auth.isAuthenticated(req, res, next)
|
||||
}
|
||||
|
||||
cancelLibraryScan(libraryId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue