Skip to content

Commit

Permalink
logout에서 status 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c committed Aug 10, 2023
1 parent 7ea66cb commit 224c23b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/api/handlers/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/api/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 224c23b

Please sign in to comment.