1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

plugins: add optional authentication for routes

This commit is contained in:
kontrollanten 2020-12-04 20:56:48 +01:00 committed by Chocobozzz
parent c824e8a0c7
commit f17faefb30
3 changed files with 26 additions and 0 deletions

View file

@ -44,6 +44,27 @@ describe('Test plugin helpers', function () {
}
})
it('Should check if authenticated', async function () {
for (const path of basePaths) {
const res = await makeGetRequest({
url: server.url,
path: path + 'is-authenticated',
token: server.accessToken,
statusCodeExpected: 200
})
expect(res.body.isAuthenticated).to.equal(undefined)
const secRes = await makeGetRequest({
url: server.url,
path: path + 'is-authenticated',
statusCodeExpected: 200
})
expect(secRes.body.isAuthenticated).to.equal(false)
}
})
it('Should mirror post body', async function () {
const body = {
hello: 'world',