Alea Ddine
commited on
Commit
·
2e30678
1
Parent(s):
0fd693e
Fix OAuth redirect URI for alae65-deepsite.hf.space
Browse files- app/api/auth/login-url/route.ts +5 -3
- app/api/auth/route.ts +2 -2
app/api/auth/login-url/route.ts
CHANGED
|
@@ -6,10 +6,12 @@ export async function GET(req: NextRequest) {
|
|
| 6 |
let url: string;
|
| 7 |
if (host.includes("localhost")) {
|
| 8 |
url = host;
|
| 9 |
-
} else if (host.includes("hf.space")
|
| 10 |
-
url = "
|
|
|
|
|
|
|
| 11 |
} else {
|
| 12 |
-
url =
|
| 13 |
}
|
| 14 |
|
| 15 |
const redirect_uri =
|
|
|
|
| 6 |
let url: string;
|
| 7 |
if (host.includes("localhost")) {
|
| 8 |
url = host;
|
| 9 |
+
} else if (host.includes("alae65-deepsite.hf.space")) {
|
| 10 |
+
url = "alae65-deepsite.hf.space";
|
| 11 |
+
} else if (host.includes("hf.space")) {
|
| 12 |
+
url = host;
|
| 13 |
} else {
|
| 14 |
+
url = host;
|
| 15 |
}
|
| 16 |
|
| 17 |
const redirect_uri =
|
app/api/auth/route.ts
CHANGED
|
@@ -24,8 +24,8 @@ export async function POST(req: NextRequest) {
|
|
| 24 |
const host =
|
| 25 |
req.headers.get("host") ?? req.headers.get("origin") ?? "localhost:3000";
|
| 26 |
|
| 27 |
-
const url = host.includes("
|
| 28 |
-
? "
|
| 29 |
: host;
|
| 30 |
const redirect_uri =
|
| 31 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
|
|
|
| 24 |
const host =
|
| 25 |
req.headers.get("host") ?? req.headers.get("origin") ?? "localhost:3000";
|
| 26 |
|
| 27 |
+
const url = host.includes("alae65-deepsite.hf.space")
|
| 28 |
+
? "alae65-deepsite.hf.space"
|
| 29 |
: host;
|
| 30 |
const redirect_uri =
|
| 31 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|