Add authorization to all routes

This commit is contained in:
Johannes Zellner
2022-09-24 21:27:43 +02:00
parent cde22cd0a3
commit 8677e86ace
3 changed files with 48 additions and 43 deletions
+3 -3
View File
@@ -64,10 +64,10 @@ describe('Tokens API', function () {
expect(tokenIds).to.contain(readOnlyToken.id);
});
it('cannot create applink with read only token', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/applinks`)
it('cannot create token with read only token', async function () {
const response = await superagent.post(`${serverUrl}/api/v1/tokens`)
.query({ access_token: readOnlyToken.accessToken })
.send({ upstreamUri: 'https://cloudron.io' })
.send({ name: 'somename' })
.ok(() => true);
expect(response.status).to.equal(403);