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 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") || host.includes("/spaces/enzostvs")) {
10
- url = "enzostvs-deepsite.hf.space";
 
 
11
  } else {
12
- url = "deepsite.hf.co";
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("/spaces/enzostvs")
28
- ? "enzostvs-deepsite.hf.space"
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://"}` +