From f9fbeadbb75f43381ffa6fff118ca7555c6df5e2 Mon Sep 17 00:00:00 2001 From: Michael Zetterberg Date: Sun, 28 Apr 2024 08:00:40 +0200 Subject: [PATCH] chore(debug): next-auth url --- app/api/web/auth/[...nextauth]/route.ts | 19 ++++++++++++++++++- next.config.js | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/api/web/auth/[...nextauth]/route.ts b/app/api/web/auth/[...nextauth]/route.ts index bb4896173..2a4c5a442 100644 --- a/app/api/web/auth/[...nextauth]/route.ts +++ b/app/api/web/auth/[...nextauth]/route.ts @@ -1,2 +1,19 @@ -export { GET, POST } from "@/auth" +import { GET as _GET, POST as _POST } from "@/auth" + +import type { NextRequest } from "next/server" + export const runtime = "edge" + +export async function GET(req: NextRequest) { + console.log({ GET_REQ: req }) + console.log({ GET_AUTH_URL: process.env.AUTH_URL }) + console.log({ GET_NEXTAUTH_URL: process.env.NEXTAUTH_URL }) + return _GET(req) +} + +export async function POST(req: NextRequest) { + console.log({ POST_REQ: req }) + console.log({ POST_AUTH_URL: process.env.AUTH_URL }) + console.log({ POST_NEXTAUTH_URL: process.env.NEXTAUTH_URL }) + return _POST(req) +} diff --git a/next.config.js b/next.config.js index d063d6367..1fd34113c 100644 --- a/next.config.js +++ b/next.config.js @@ -19,6 +19,9 @@ jiti("./env/client") // Otherwise we fallback to DEPLOY_PRIME_URL from Netlify built-in variables. // Locally we set DEPLOY_PRIME_URL const ENV_URL = process.env.SCANDIC_ENV_URL || process.env.DEPLOY_PRIME_URL +console.log({ config_SCANDIC_ENV_URL: process.env.SCANDIC_ENV_URL }) +console.log({ config_DEPLOY_PRIME_URL: process.env.DEPLOY_PRIME_URL }) +console.log({ ENV_URL }) // We set NEXTAUTH_URL here because next.config.js is included in Netlify // functions when bundling. Otherwise we are unable to login on preview