mirror of https://github.com/Chocobozzz/PeerTube
server/mw/oauth: res.loc.auth to true upon auth
Setting res.locals.authenticated explicity to true makes it's more clear whether the req is authenticated when using optionalAuthenticate middlware.pull/3432/head
parent
f17faefb30
commit
2805cb7cb6
|
@ -20,6 +20,8 @@ function authenticate (req: express.Request, res: express.Response, next: expres
|
|||
.end()
|
||||
}
|
||||
|
||||
res.locals.authenticated = true
|
||||
|
||||
return next()
|
||||
})
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ describe('Test plugin helpers', function () {
|
|||
statusCodeExpected: 200
|
||||
})
|
||||
|
||||
expect(res.body.isAuthenticated).to.equal(undefined)
|
||||
expect(res.body.isAuthenticated).to.equal(true)
|
||||
|
||||
const secRes = await makeGetRequest({
|
||||
url: server.url,
|
||||
|
|
Loading…
Reference in New Issue