diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-10 18:19:14 -0700 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2024-02-13 06:59:44 +0530 |
commit | 7584d2d7a7110aef0331ebfa178b2295842c59fa (patch) | |
tree | 900cd71237e6231b57936fcce77ff229cd459041 /app/Middleware/SilentAuth.ts | |
parent | upgrade recipes submodule (diff) | |
download | ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.gz ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.zst ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'app/Middleware/SilentAuth.ts')
-rw-r--r-- | app/Middleware/SilentAuth.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/app/Middleware/SilentAuth.ts b/app/Middleware/SilentAuth.ts index ee73ec4..a7271d5 100644 --- a/app/Middleware/SilentAuth.ts +++ b/app/Middleware/SilentAuth.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | 1 | import { HttpContext } from '@adonisjs/core/http' |
2 | 2 | ||
3 | /** | 3 | /** |
4 | * Silent auth middleware can be used as a global middleware to silent check | 4 | * Silent auth middleware can be used as a global middleware to silent check |
@@ -10,15 +10,12 @@ export default class SilentAuthMiddleware { | |||
10 | /** | 10 | /** |
11 | * Handle request | 11 | * Handle request |
12 | */ | 12 | */ |
13 | public async handle( | 13 | public async handle({ auth }: HttpContext, next: () => Promise<void>) { |
14 | { auth }: HttpContextContract, | ||
15 | next: () => Promise<void>, | ||
16 | ) { | ||
17 | /** | 14 | /** |
18 | * Check if user is logged-in or not. If yes, then `ctx.auth.user` will be | 15 | * Check if user is logged-in or not. If yes, then `ctx.auth.user` will be |
19 | * set to the instance of the currently logged in user. | 16 | * set to the instance of the currently logged in user. |
20 | */ | 17 | */ |
21 | await auth.check(); | 18 | await auth.check() |
22 | await next(); | 19 | await next() |
23 | } | 20 | } |
24 | } | 21 | } |