mirror of
https://github.com/different-ai/openwork
synced 2026-04-26 09:35:17 +02:00
fix(auth): move github oauth callbacks to app domain (#801)
This commit is contained in:
32
packages/web/app/api/auth/[...path]/route.ts
Normal file
32
packages/web/app/api/auth/[...path]/route.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import { NextRequest } from "next/server";
|
||||
import { proxyUpstream } from "../../_lib/upstream-proxy";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
async function proxy(request: NextRequest, segments: string[] = []) {
|
||||
return proxyUpstream(request, segments, {
|
||||
routePrefix: "/api/auth",
|
||||
upstreamPathPrefix: "api/auth",
|
||||
rewriteAuthLocationsToRequestOrigin: true,
|
||||
});
|
||||
}
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
return proxy(request);
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
return proxy(request);
|
||||
}
|
||||
|
||||
export async function PUT(request: NextRequest) {
|
||||
return proxy(request);
|
||||
}
|
||||
|
||||
export async function PATCH(request: NextRequest) {
|
||||
return proxy(request);
|
||||
}
|
||||
|
||||
export async function DELETE(request: NextRequest) {
|
||||
return proxy(request);
|
||||
}
|
||||
Reference in New Issue
Block a user