Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

server/mw/oauth: res.loc.auth to true upon auth

kontrollanten2805cb7cb68c
diff --git a/server/middlewares/oauth.ts b/server/middlewares/oauth.ts
index ab53014154..ffc1b7ca95 100644
--- a/server/middlewares/oauth.ts
+++ b/server/middlewares/oauth.ts
@@ -20,6 +20,8 @@ function authenticate (req: express.Request, res: express.Response, next: expres
.end()
}
+ res.locals.authenticated = true
+
return next()
})
}
diff --git a/server/tests/plugins/plugin-router.ts b/server/tests/plugins/plugin-router.ts
index 5392acc51a..24e6a1e834 100644
--- a/server/tests/plugins/plugin-router.ts
+++ b/server/tests/plugins/plugin-router.ts
@@ -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,