Skip to content

Commit 004d644

Browse files
kjetilkrubensworks
authored andcommitted
Add more tests for origins without auth cookie
1 parent 6f2261e commit 004d644

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

test/integration/authentication-oidc-test.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,37 @@ describe('Authentication API (OIDC)', () => {
240240
expect(response).to.have.property('status', 401)
241241
})
242242
})
243+
244+
describe('without that cookie but with a matching origin', () => {
245+
let response
246+
before(done => {
247+
alice.get('/')
248+
.set('Origin', aliceServerUri)
249+
.end((err, res) => {
250+
response = res
251+
done(err)
252+
})
253+
})
254+
255+
it('should return a 401', () => {
256+
expect(response).to.have.property('status', 401)
257+
})
258+
})
259+
describe('without that cookie and a matching origin', () => {
260+
let response
261+
before(done => {
262+
alice.get('/')
263+
.set('Origin', bobServerUri)
264+
.end((err, res) => {
265+
response = res
266+
done(err)
267+
})
268+
})
269+
270+
it('should return a 401', () => {
271+
expect(response).to.have.property('status', 401)
272+
})
273+
})
243274
})
244275
})
245276

0 commit comments

Comments
 (0)