aboutsummaryrefslogtreecommitdiffstats
path: root/app/Middleware/Dashboard.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/Middleware/Dashboard.ts')
-rw-r--r--app/Middleware/Dashboard.ts15
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 @@
1import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; 1import type { HttpContext } from '@adonisjs/core/http'
2import Config from '@ioc:Adonis/Core/Config'; 2import { Config } from '@adonisjs/core/config'
3 3
4export default class Dashboard { 4export 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}