Spaces:
Running
Running
check origin
Browse files- app/api/auth/route.ts +3 -0
app/api/auth/route.ts
CHANGED
@@ -3,6 +3,9 @@ import { NextRequest, NextResponse } from "next/server";
|
|
3 |
export async function GET(req: NextRequest) {
|
4 |
const host =
|
5 |
req.headers.get("host") ?? req.headers.get("origin") ?? "localhost:3000";
|
|
|
|
|
|
|
6 |
const redirect_uri =
|
7 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
8 |
host +
|
|
|
3 |
export async function GET(req: NextRequest) {
|
4 |
const host =
|
5 |
req.headers.get("host") ?? req.headers.get("origin") ?? "localhost:3000";
|
6 |
+
|
7 |
+
console.log("Host:", req.headers.get("host"));
|
8 |
+
console.log("Origin:", req.headers.get("origin"));
|
9 |
const redirect_uri =
|
10 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
11 |
host +
|