diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-11 19:15:20 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2024-02-13 06:59:44 +0530 |
commit | 8fec21d6bccfa778c14c1714d6444312e36fc3f1 (patch) | |
tree | cab910ad5048eece2d229648f2c17000ac86a44d /app/Middleware | |
parent | updates (diff) | |
download | ferdium-server-03e8c2b08e08822bcd069ad482799eecf1ede777.tar.gz ferdium-server-03e8c2b08e08822bcd069ad482799eecf1ede777.tar.zst ferdium-server-03e8c2b08e08822bcd069ad482799eecf1ede777.zip |
Diffstat (limited to 'app/Middleware')
-rw-r--r-- | app/Middleware/Auth.ts | 3 | ||||
-rw-r--r-- | app/Middleware/Dashboard.ts | 4 |
2 files changed, 4 insertions, 3 deletions
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'; | |||
3 | import { AuthenticationException } from '@adonisjs/auth/build/standalone'; | 3 | import { AuthenticationException } from '@adonisjs/auth/build/standalone'; |
4 | import * as jose from 'jose'; | 4 | import * as jose from 'jose'; |
5 | import { appKey } from '#config/app'; | 5 | import { appKey } from '#config/app'; |
6 | import User from '#app/Models/User'; | 6 | import User from '#models/User'; |
7 | 7 | ||
8 | /** | 8 | /** |
9 | * Auth middleware is meant to restrict un-authenticated access to a given route | 9 | * Auth middleware is meant to restrict un-authenticated access to a given route |
@@ -94,6 +94,7 @@ export default class AuthMiddleware { | |||
94 | /** | 94 | /** |
95 | * Handle request | 95 | * Handle request |
96 | */ | 96 | */ |
97 | // eslint-disable-next-line consistent-return | ||
97 | public async handle( | 98 | public async handle( |
98 | { request, auth, response }: HttpContext, | 99 | { request, auth, response }: HttpContext, |
99 | next: () => Promise<void>, | 100 | next: () => Promise<void>, |
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 @@ | |||
1 | import type { HttpContext } from '@adonisjs/core/http'; | 1 | import type { HttpContext } from '@adonisjs/core/http'; |
2 | import { Config } from '@adonisjs/core/config'; | 2 | import config from '@adonisjs/core/services/config'; |
3 | 3 | ||
4 | export default class Dashboard { | 4 | export default class Dashboard { |
5 | public async handle({ response }: HttpContext, next: () => Promise<void>) { | 5 | public async handle({ response }: HttpContext, next: () => Promise<void>) { |
6 | if (Config.get('dashboard.enabled') === false) { | 6 | if (config.get('dashboard.enabled') === false) { |
7 | response.send( | 7 | response.send( |
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.', | 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.', |
9 | ); | 9 | ); |