mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Make /api/security/v1/login
to return 204
status code if no payload is provided. (#21391)
This commit is contained in:
parent
9fc4438fae
commit
37d12fad03
3 changed files with 8 additions and 2 deletions
|
@ -64,6 +64,9 @@ describe('Authentication routes', () => {
|
|||
username: Joi.string().required(),
|
||||
password: Joi.string().required()
|
||||
}
|
||||
},
|
||||
response: {
|
||||
emptyStatusCode: 204,
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -23,6 +23,9 @@ export function initAuthenticateApi(server) {
|
|||
username: Joi.string().required(),
|
||||
password: Joi.string().required()
|
||||
}
|
||||
},
|
||||
response: {
|
||||
emptyStatusCode: 204,
|
||||
}
|
||||
},
|
||||
async handler(request, reply) {
|
||||
|
|
|
@ -54,7 +54,7 @@ export default function ({ getService }) {
|
|||
const loginResponse = await supertest.post('/api/security/v1/login')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ username: validUsername, password: validPassword })
|
||||
.expect(200);
|
||||
.expect(204);
|
||||
|
||||
const cookies = loginResponse.headers['set-cookie'];
|
||||
expect(cookies).to.have.length(1);
|
||||
|
@ -111,7 +111,7 @@ export default function ({ getService }) {
|
|||
const loginResponse = await supertest.post('/api/security/v1/login')
|
||||
.set('kbn-xsrf', 'xxx')
|
||||
.send({ username: validUsername, password: validPassword })
|
||||
.expect(200);
|
||||
.expect(204);
|
||||
|
||||
sessionCookie = request.cookie(loginResponse.headers['set-cookie'][0]);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue