diff options
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 | } |