From 8fec21d6bccfa778c14c1714d6444312e36fc3f1 Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sun, 11 Feb 2024 19:15:20 +0530 Subject: more updates --- app/Middleware/Auth.ts | 3 ++- app/Middleware/Dashboard.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'app/Middleware') diff --git a/app/Middleware/Auth.ts b/app/Middleware/Auth.ts index b6ff446..58d5b76 100644 --- a/app/Middleware/Auth.ts +++ b/app/Middleware/Auth.ts @@ -3,7 +3,7 @@ import { HttpContext } from '@adonisjs/core/http'; import { AuthenticationException } from '@adonisjs/auth/build/standalone'; import * as jose from 'jose'; import { appKey } from '#config/app'; -import User from '#app/Models/User'; +import User from '#models/User'; /** * Auth middleware is meant to restrict un-authenticated access to a given route @@ -94,6 +94,7 @@ export default class AuthMiddleware { /** * Handle request */ + // eslint-disable-next-line consistent-return public async handle( { request, auth, response }: HttpContext, next: () => Promise, diff --git a/app/Middleware/Dashboard.ts b/app/Middleware/Dashboard.ts index 19c8cfc..20113b7 100644 --- a/app/Middleware/Dashboard.ts +++ b/app/Middleware/Dashboard.ts @@ -1,9 +1,9 @@ import type { HttpContext } from '@adonisjs/core/http'; -import { Config } from '@adonisjs/core/config'; +import config from '@adonisjs/core/services/config'; export default class Dashboard { public async handle({ response }: HttpContext, next: () => Promise) { - if (Config.get('dashboard.enabled') === false) { + if (config.get('dashboard.enabled') === false) { response.send( '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.', ); -- cgit v1.2.3-54-g00ecf