diff --git a/app/Middleware/Auth.ts b/app/Middleware/Auth.ts index 262c309..33bbf26 100755 --- a/app/Middleware/Auth.ts +++ b/app/Middleware/Auth.ts @@ -1,5 +1,6 @@ -import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext' -import { AuthenticationException } from '@adonisjs/auth/build/standalone' +import {HttpContextContract} from '@ioc:Adonis/Core/HttpContext' +import {AuthenticationException} from '@adonisjs/auth/build/standalone' +import Logger from "@ioc:Adonis/Core/Logger"; /** * Auth middleware is meant to restrict un-authenticated access to a given route @@ -32,9 +33,10 @@ export default class AuthMiddleware { let guardLastAttempted: string | undefined for (let guard of guards) { - guardLastAttempted = guard - + guardLastAttempted = guard + Logger.info('Trying to connect with ' + guard) if (await auth.use(guard).check()) { + Logger.info(auth.use(guard).isLoggedIn) /** * Instruct auth to use the given guard as the default guard for * the rest of the request, since the user authenticated