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:
parent
c824e8a0c7
commit
f17faefb30
3 changed files with 26 additions and 0 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue