Skip to content

Commit f968fc6

Browse files
committed
Add more tests for origins without auth cookie
1 parent 6e2a9a6 commit f968fc6

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
@@ -209,6 +209,37 @@ describe('Authentication API (OIDC)', () => {
209209
expect(response).to.have.property('status', 200)
210210
})
211211
})
212+
213+
describe('without that cookie but with a matching origin', () => {
214+
let response
215+
before(done => {
216+
alice.get('/')
217+
.set('Origin', aliceServerUri)
218+
.end((err, res) => {
219+
response = res
220+
done(err)
221+
})
222+
})
223+
224+
it('should return a 401', () => {
225+
expect(response).to.have.property('status', 401)
226+
})
227+
})
228+
describe('without that cookie and a matching origin', () => {
229+
let response
230+
before(done => {
231+
alice.get('/')
232+
.set('Origin', bobServerUri)
233+
.end((err, res) => {
234+
response = res
235+
done(err)
236+
})
237+
})
238+
239+
it('should return a 401', () => {
240+
expect(response).to.have.property('status', 401)
241+
})
242+
})
212243
})
213244
})
214245

0 commit comments

Comments
 (0)