Merged in feat/api-web (pull request #110)
chore: move /api to /api/web
This commit is contained in:
@@ -12,9 +12,9 @@ CURITY_CLIENT_SECRET_USER=""
|
|||||||
CURITY_ISSUER_USER="https://testlogin.scandichotels.com"
|
CURITY_ISSUER_USER="https://testlogin.scandichotels.com"
|
||||||
CYPRESS_BASE_URL="http://localhost:3000"
|
CYPRESS_BASE_URL="http://localhost:3000"
|
||||||
DESIGN_SYSTEM_ACCESS_TOKEN=""
|
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_SECRET=""
|
||||||
NEXTAUTH_URL="http://localhost:3000/api/auth"
|
NEXTAUTH_URL="http://localhost:3000/api/web/auth"
|
||||||
REVALIDATE_SECRET=""
|
REVALIDATE_SECRET=""
|
||||||
SEAMLESS_LOGIN_DA="http://www.example.dk/updatelogin"
|
SEAMLESS_LOGIN_DA="http://www.example.dk/updatelogin"
|
||||||
SEAMLESS_LOGIN_DE="http://www.example.de/updatelogin"
|
SEAMLESS_LOGIN_DE="http://www.example.de/updatelogin"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { createContext } from "@/server/context"
|
|||||||
async function handler(req: Request) {
|
async function handler(req: Request) {
|
||||||
return fetchRequestHandler({
|
return fetchRequestHandler({
|
||||||
createContext,
|
createContext,
|
||||||
endpoint: "/api/trpc",
|
endpoint: "/api/web/trpc",
|
||||||
req,
|
req,
|
||||||
router: appRouter,
|
router: appRouter,
|
||||||
})
|
})
|
||||||
1
auth.ts
1
auth.ts
@@ -45,6 +45,7 @@ const customProvider = {
|
|||||||
} satisfies OIDCConfig<User>
|
} satisfies OIDCConfig<User>
|
||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
|
basePath: "/api/web/auth",
|
||||||
providers: [customProvider],
|
providers: [customProvider],
|
||||||
redirectProxyUrl: env.NEXTAUTH_REDIRECT_PROXY_URL,
|
redirectProxyUrl: env.NEXTAUTH_REDIRECT_PROXY_URL,
|
||||||
trustHost: true,
|
trustHost: true,
|
||||||
|
|||||||
@@ -35,22 +35,22 @@ export default async function Sidebar({ lang }: SidebarProps) {
|
|||||||
</Link>
|
</Link>
|
||||||
{item.subItems
|
{item.subItems
|
||||||
? item.subItems.map((subItem) => {
|
? item.subItems.map((subItem) => {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
key={subItem.uid}
|
key={subItem.uid}
|
||||||
href={subItem.url}
|
href={subItem.url}
|
||||||
partialMatch
|
partialMatch
|
||||||
variant="sidebar"
|
variant="sidebar"
|
||||||
>
|
>
|
||||||
{subItem.linkText}
|
{subItem.linkText}
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
: null}
|
: null}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<Link href="/api/auth/signout" variant="sidebar">
|
<Link href="/api/web/auth/signout" variant="sidebar">
|
||||||
Log out <LogOut height={16} width={16} />
|
Log out <LogOut height={16} width={16} />
|
||||||
</Link>
|
</Link>
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ function initializeTrpcClient() {
|
|||||||
/**
|
/**
|
||||||
* This is locally in Next.js
|
* 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`,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user