diff options
Diffstat (limited to 'app/Controllers/Http/Dashboard/LogOutController.ts')
-rw-r--r-- | app/Controllers/Http/Dashboard/LogOutController.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/Controllers/Http/Dashboard/LogOutController.ts b/app/Controllers/Http/Dashboard/LogOutController.ts new file mode 100644 index 0000000..41cbd31 --- /dev/null +++ b/app/Controllers/Http/Dashboard/LogOutController.ts | |||
@@ -0,0 +1,12 @@ | |||
1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | ||
2 | |||
3 | export default class LogOutController { | ||
4 | /** | ||
5 | * Login a user | ||
6 | */ | ||
7 | public async logout({ auth, response }: HttpContextContract) { | ||
8 | auth.logout(); | ||
9 | |||
10 | return response.redirect('/user/login'); | ||
11 | } | ||
12 | } | ||