app/Controllers/Http/LogoutController.ts   A
last analyzed

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 22
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 15
mnd 2
bc 2
fnc 2
dl 0
loc 22
bpm 1
cpm 2
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A LogoutsController.logout 0 14 2
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