diff --git a/.env.local.example b/.env.local.example index c84de656b..9345303b2 100644 --- a/.env.local.example +++ b/.env.local.example @@ -12,9 +12,9 @@ CURITY_CLIENT_SECRET_USER="" CURITY_ISSUER_USER="https://testlogin.scandichotels.com" CYPRESS_BASE_URL="http://localhost:3000" DESIGN_SYSTEM_ACCESS_TOKEN="" -NEXTAUTH_REDIRECT_PROXY_URL="http://localhost:3000/api/auth" +NEXTAUTH_REDIRECT_PROXY_URL="http://localhost:3000/api/web/auth" NEXTAUTH_SECRET="" -NEXTAUTH_URL="http://localhost:3000/api/auth" +NEXTAUTH_URL="http://localhost:3000/api/web/auth" REVALIDATE_SECRET="" SEAMLESS_LOGIN_DA="http://www.example.dk/updatelogin" SEAMLESS_LOGIN_DE="http://www.example.de/updatelogin" diff --git a/app/api/auth/[...nextauth]/route.ts b/app/api/web/auth/[...nextauth]/route.ts similarity index 100% rename from app/api/auth/[...nextauth]/route.ts rename to app/api/web/auth/[...nextauth]/route.ts diff --git a/app/api/revalidate/route.ts b/app/api/web/revalidate/route.ts similarity index 100% rename from app/api/revalidate/route.ts rename to app/api/web/revalidate/route.ts diff --git a/app/api/trpc/[trpc]/route.ts b/app/api/web/trpc/[trpc]/route.ts similarity index 91% rename from app/api/trpc/[trpc]/route.ts rename to app/api/web/trpc/[trpc]/route.ts index 2f357d41f..72978cedb 100644 --- a/app/api/trpc/[trpc]/route.ts +++ b/app/api/web/trpc/[trpc]/route.ts @@ -6,7 +6,7 @@ import { createContext } from "@/server/context" async function handler(req: Request) { return fetchRequestHandler({ createContext, - endpoint: "/api/trpc", + endpoint: "/api/web/trpc", req, router: appRouter, }) diff --git a/auth.ts b/auth.ts index 530238896..52456236c 100644 --- a/auth.ts +++ b/auth.ts @@ -45,6 +45,7 @@ const customProvider = { } satisfies OIDCConfig export const config = { + basePath: "/api/web/auth", providers: [customProvider], redirectProxyUrl: env.NEXTAUTH_REDIRECT_PROXY_URL, trustHost: true, diff --git a/components/MyPages/Sidebar/index.tsx b/components/MyPages/Sidebar/index.tsx index 2f9f6fdd6..13e6a77a5 100644 --- a/components/MyPages/Sidebar/index.tsx +++ b/components/MyPages/Sidebar/index.tsx @@ -35,22 +35,22 @@ export default async function Sidebar({ lang }: SidebarProps) { {item.subItems ? item.subItems.map((subItem) => { - return ( - - {subItem.linkText} - - ) - }) + return ( + + {subItem.linkText} + + ) + }) : null} ))} - + Log out diff --git a/lib/trpc/Provider.tsx b/lib/trpc/Provider.tsx index 1c61c6885..d1ef255c7 100644 --- a/lib/trpc/Provider.tsx +++ b/lib/trpc/Provider.tsx @@ -15,7 +15,7 @@ function initializeTrpcClient() { /** * This is locally in Next.js */ - url: `http://localhost:${env.NEXT_PUBLIC_PORT}/api/trpc`, + url: `http://localhost:${env.NEXT_PUBLIC_PORT}/api/web/trpc`, }), ], })