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-17 21:51:20 +0530 |
commit | a61e73c33b2e80d5af58e3dcfa2efe74245cd065 (patch) | |
tree | d5343ad245b4156662920896dedf14d9284051f8 /app/Middleware/Dashboard.ts | |
parent | upgrade node to 20.11.1 and other minor versions for pkgs (#104) (diff) | |
download | ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.tar.gz ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.tar.zst ferdium-server-a61e73c33b2e80d5af58e3dcfa2efe74245cd065.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 | } |