(req: any, res: any)
| 2 | import { connection } from '../server/database'; |
| 3 | |
| 4 | export const logoutUser = (req: any, res: any) => { |
| 5 | const { token } = req.body; |
| 6 | const activeSessionRepository = connection!.getRepository(ActiveSession); |
| 7 | |
| 8 | activeSessionRepository.delete({ token }) |
| 9 | .then(() => res.json({ success: true })) |
| 10 | .catch(() => { |
| 11 | res.json({ success: false, msg: 'Token revoked' }); |
| 12 | }); |
| 13 | } |
nothing calls this directly
no outgoing calls
no test coverage detected