From 69065a03c035eefae622920fb2194218d20c520a Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Fri, 2 Jul 2021 12:58:39 +0200 Subject: [PATCH] Working Signed-off-by: Arthur DANJOU --- app/Middleware/Auth.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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