fix
Browse files
app/api/auth/login-url/route.ts
CHANGED
|
@@ -2,9 +2,16 @@ import { NextRequest, NextResponse } from "next/server";
|
|
| 2 |
|
| 3 |
export async function GET(req: NextRequest) {
|
| 4 |
const host = req.headers.get("host") ?? "localhost:3000";
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
const redirect_uri =
|
| 9 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 10 |
url +
|
|
|
|
| 2 |
|
| 3 |
export async function GET(req: NextRequest) {
|
| 4 |
const host = req.headers.get("host") ?? "localhost:3000";
|
| 5 |
+
|
| 6 |
+
let url: string;
|
| 7 |
+
if (process.env.NODE_ENV === "production") {
|
| 8 |
+
url = "deepsite.hf.co";
|
| 9 |
+
} else if (host.includes("/spaces/enzostvs")) {
|
| 10 |
+
url = "enzostvs-deepsite.hf.space";
|
| 11 |
+
} else {
|
| 12 |
+
url = host;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
const redirect_uri =
|
| 16 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 17 |
url +
|