Skip to content

Commit a37ef67

Browse files
committed
feat: auth controller logout
1 parent 0d80755 commit a37ef67

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/controllers/Auth/controller.ts

+13
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,16 @@ routes.get(
7575
return res.status(200).json(buildResponse)
7676
})
7777
)
78+
79+
routes.post(
80+
'/logout',
81+
Authorization,
82+
asyncHandler(async function logout(req: Request, res: Response) {
83+
const { UserId } = req.getBody()
84+
85+
await AuthService.logout(UserId)
86+
const buildResponse = BuildResponse.deleted({})
87+
88+
return res.status(200).json(buildResponse)
89+
})
90+
)

0 commit comments

Comments
 (0)