debug: add logging

This commit is contained in:
Arvid Norlin
2024-05-24 11:36:00 +02:00
parent f2b8ddae8e
commit c45380d8e2
3 changed files with 20 additions and 17 deletions

View File

@@ -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

34
auth.ts
View File

@@ -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")

View File

@@ -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()