From 224c23b21ab10f8f562555743db87ea41628e655 Mon Sep 17 00:00:00 2001 From: Wonwoo Choi Date: Thu, 10 Aug 2023 22:59:19 +0900 Subject: [PATCH] =?UTF-8?q?logout=EC=97=90=EC=84=9C=20status=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/handlers/login.ts | 1 + test/api/login.test.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/handlers/login.ts b/src/api/handlers/login.ts index cf5116f..293da48 100644 --- a/src/api/handlers/login.ts +++ b/src/api/handlers/login.ts @@ -127,6 +127,7 @@ export function loginLegacy(model: Model, config: Config): IMiddleware { export function logout(): IMiddleware { return async (ctx, next) => { await ctx.state.destroySession() + ctx.status = 204 await next() } } diff --git a/test/api/login.test.ts b/test/api/login.test.ts index 52bcbfd..15ea62e 100644 --- a/test/api/login.test.ts +++ b/test/api/login.test.ts @@ -259,7 +259,7 @@ test('test checkLogin', async t => { t.is(response.body.username, username) response = await agent.post('/api/logout').send() - t.is(response.status, 200) + t.is(response.status, 204) response = await agent.get('/api/check-login').send() t.is(response.status, 401)