backend-app-api: fix cookie delete response

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-04-09 15:17:33 +02:00
parent 33223c7937
commit 30c7ed4bad
2 changed files with 2 additions and 2 deletions
@@ -43,7 +43,7 @@ describe('createCookieAuthRefreshMiddleware', () => {
it('should remove the user cookie', async () => {
const response = await request(app).delete('/.backstage/auth/v1/cookie');
expect(response.status).toBe(200);
expect(response.status).toBe(204);
expect(response.header['set-cookie'][0]).toMatch('backstage-auth=');
});
});
@@ -40,7 +40,7 @@ export function createCookieAuthRefreshMiddleware(options: {
router.delete(WELL_KNOWN_COOKIE_PATH_V1, async (_, res) => {
const credentials = await auth.getNoneCredentials();
await httpAuth.issueUserCookie(res, { credentials });
res.send(200);
res.status(204).end();
});
return router;