From c45380d8e278e5ea2f302f2c1c50a343bf8df9ca Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Fri, 24 May 2024 11:36:00 +0200 Subject: [PATCH] debug: add logging --- app/[lang]/(live)/(protected)/logout/route.ts | 1 + auth.ts | 34 +++++++++---------- middlewares/currentWebLogout.ts | 2 ++ 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/[lang]/(live)/(protected)/logout/route.ts b/app/[lang]/(live)/(protected)/logout/route.ts index 23ae2ffc0..331ab9efd 100644 --- a/app/[lang]/(live)/(protected)/logout/route.ts +++ b/app/[lang]/(live)/(protected)/logout/route.ts @@ -13,6 +13,7 @@ export async function GET( request: NextRequest, context: { params: { lang: Lang } } ) { + console.log("LOGOUT ROUTE DEBUG") let redirectHeaders: Headers | undefined = undefined let redirectTo: string diff --git a/auth.ts b/auth.ts index 778824aea..0b1b4bdce 100644 --- a/auth.ts +++ b/auth.ts @@ -146,23 +146,23 @@ export const config = { } }, }, - // events: { - // async signIn() { - // console.log("#### SIGNIN EVENT ARGS ######") - // console.log(arguments) - // console.log("#### END - SIGNIN EVENT ARGS ######") - // }, - // async signOut() { - // console.log("#### SIGNOUT EVENT ARGS ######") - // console.log(arguments) - // console.log("#### END - SIGNOUT EVENT ARGS ######") - // }, - // async session() { - // console.log("#### SESSION EVENT ARGS ######") - // console.log(arguments) - // console.log("#### END - SESSION EVENT ARGS ######") - // }, - // }, + events: { + async signIn() { + console.log("#### SIGNIN EVENT ARGS ######") + console.log(arguments) + console.log("#### END - SIGNIN EVENT ARGS ######") + }, + async signOut() { + console.log("#### SIGNOUT EVENT ARGS ######") + console.log(arguments) + console.log("#### END - SIGNOUT EVENT ARGS ######") + }, + async session() { + console.log("#### SESSION EVENT ARGS ######") + console.log(arguments) + console.log("#### END - SESSION EVENT ARGS ######") + }, + }, // logger: { // error(code, ...message) { // console.info("ERROR LOGGER") diff --git a/middlewares/currentWebLogout.ts b/middlewares/currentWebLogout.ts index 8dacd770a..863dc47c5 100644 --- a/middlewares/currentWebLogout.ts +++ b/middlewares/currentWebLogout.ts @@ -8,6 +8,8 @@ import type { NextMiddleware } from "next/server" import type { MiddlewareMatcher } from "@/types/middleware" export const middleware: NextMiddleware = (request) => { + console.log("CURRENT WEB LOGOUT MIDDLEWARE") + console.log(request) const currentwebUrl = request.nextUrl.searchParams.get("currentweb") if (currentwebUrl == null || undefined) { return badRequest()