diff options
author | 2024-02-10 18:19:14 -0700 | |
---|---|---|
committer | 2024-02-13 06:59:44 +0530 | |
commit | 7584d2d7a7110aef0331ebfa178b2295842c59fa (patch) | |
tree | 900cd71237e6231b57936fcce77ff229cd459041 /app/Middleware/Dashboard.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/Dashboard.ts')
-rw-r--r-- | app/Middleware/Dashboard.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/app/Middleware/Dashboard.ts b/app/Middleware/Dashboard.ts index 62deea0..f29794c 100644 --- a/app/Middleware/Dashboard.ts +++ b/app/Middleware/Dashboard.ts | |||
@@ -1,17 +1,14 @@ | |||
1 | import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | 1 | import type { HttpContext } from '@adonisjs/core/http' |
2 | import Config from '@ioc:Adonis/Core/Config'; | 2 | import { Config } from '@adonisjs/core/config' |
3 | 3 | ||
4 | export default class Dashboard { | 4 | export default class Dashboard { |
5 | public async handle( | 5 | public async handle({ response }: HttpContext, next: () => Promise<void>) { |
6 | { response }: HttpContextContract, | ||
7 | next: () => Promise<void>, | ||
8 | ) { | ||
9 | if (Config.get('dashboard.enabled') === false) { | 6 | if (Config.get('dashboard.enabled') === false) { |
10 | response.send( | 7 | response.send( |
11 | 'The user dashboard is disabled on this server\n\nIf you are the server owner, please set IS_DASHBOARD_ENABLED to true to enable the dashboard.', | 8 | 'The user dashboard is disabled on this server\n\nIf you are the server owner, please set IS_DASHBOARD_ENABLED to true to enable the dashboard.' |
12 | ); | 9 | ) |
13 | } else { | 10 | } else { |
14 | await next(); | 11 | await next() |
15 | } | 12 | } |
16 | } | 13 | } |
17 | } | 14 | } |