oauth fillUser

This commit is contained in:
les
2020-01-30 12:39:32 +01:00
parent 6ad7fd1d79
commit 00c35650d0
2 changed files with 9 additions and 2 deletions

View File

@@ -10,6 +10,13 @@ const Auth = {
return oauth.oauthServer.authenticate()(req, res, next)
},
fillUser (req, res, next) {
oauth.oauthServer.authenticate()(req, res, () => {
req.user = res.locals.oauth.token.user
next()
})
},
/** isAdmin middleware */
isAdmin (req, res, next) {
oauth.oauthServer.authenticate()(req, res, () => {