chore: move /api to /api/web

This commit is contained in:
Michael Zetterberg
2024-04-16 10:41:54 +02:00
parent bc381ea65f
commit 41c29efd82
7 changed files with 17 additions and 16 deletions

View File

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

View File

@@ -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,
})

View File

@@ -45,6 +45,7 @@ const customProvider = {
} satisfies OIDCConfig<User>
export const config = {
basePath: "/api/web/auth",
providers: [customProvider],
redirectProxyUrl: env.NEXTAUTH_REDIRECT_PROXY_URL,
trustHost: true,

View File

@@ -35,22 +35,22 @@ export default async function Sidebar({ lang }: SidebarProps) {
</Link>
{item.subItems
? item.subItems.map((subItem) => {
return (
<Link
key={subItem.uid}
href={subItem.url}
partialMatch
variant="sidebar"
>
{subItem.linkText}
</Link>
)
})
return (
<Link
key={subItem.uid}
href={subItem.url}
partialMatch
variant="sidebar"
>
{subItem.linkText}
</Link>
)
})
: null}
</Fragment>
))}
<Link href="/api/auth/signout" variant="sidebar">
<Link href="/api/web/auth/signout" variant="sidebar">
Log out <LogOut height={16} width={16} />
</Link>
</nav>

View File

@@ -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`,
}),
],
})