| Total Complexity | 4 |
| Complexity/F | 2 |
| Lines of Code | 22 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' |
||
| 2 | |||
| 3 | export default class LogoutsController { |
||
| 4 | public async logout({ auth }: HttpContextContract) |
||
| 5 | { |
||
| 6 | const USER = auth.use('api') |
||
| 7 | |||
| 8 | await USER.revoke() |
||
| 9 | |||
| 10 | if (USER.isLoggedOut) { |
||
| 11 | return { |
||
| 12 | user: null, |
||
| 13 | } |
||
| 14 | } |
||
| 15 | |||
| 16 | return { |
||
| 17 | user: USER |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | } |
||
| 22 |