Spaces:
Running
Running
fix error
Browse files- app/actions/auth.ts +1 -1
- app/api/auth/login-url/route.ts +1 -1
- app/api/auth/route.ts +1 -1
app/actions/auth.ts
CHANGED
|
@@ -11,7 +11,7 @@ export async function getAuth() {
|
|
| 11 |
const redirect_uri =
|
| 12 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 13 |
url +
|
| 14 |
-
"/auth/callback";
|
| 15 |
|
| 16 |
const loginRedirectUrl = `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${redirect_uri}&response_type=code&scope=openid%20profile%20write-repos%20manage-repos%20inference-api&prompt=consent&state=1234567890`;
|
| 17 |
return loginRedirectUrl;
|
|
|
|
| 11 |
const redirect_uri =
|
| 12 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 13 |
url +
|
| 14 |
+
"/deepsite/auth/callback";
|
| 15 |
|
| 16 |
const loginRedirectUrl = `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${redirect_uri}&response_type=code&scope=openid%20profile%20write-repos%20manage-repos%20inference-api&prompt=consent&state=1234567890`;
|
| 17 |
return loginRedirectUrl;
|
app/api/auth/login-url/route.ts
CHANGED
|
@@ -15,7 +15,7 @@ export async function GET(req: NextRequest) {
|
|
| 15 |
const redirect_uri =
|
| 16 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 17 |
url +
|
| 18 |
-
"/auth/callback";
|
| 19 |
|
| 20 |
const loginRedirectUrl = `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${redirect_uri}&response_type=code&scope=openid%20profile%20write-repos%20manage-repos%20inference-api&prompt=consent&state=1234567890`;
|
| 21 |
|
|
|
|
| 15 |
const redirect_uri =
|
| 16 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 17 |
url +
|
| 18 |
+
"/deepsite/auth/callback";
|
| 19 |
|
| 20 |
const loginRedirectUrl = `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${redirect_uri}&response_type=code&scope=openid%20profile%20write-repos%20manage-repos%20inference-api&prompt=consent&state=1234567890`;
|
| 21 |
|
app/api/auth/route.ts
CHANGED
|
@@ -30,7 +30,7 @@ export async function POST(req: NextRequest) {
|
|
| 30 |
const redirect_uri =
|
| 31 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 32 |
url +
|
| 33 |
-
"/auth/callback";
|
| 34 |
const request_auth = await fetch("https://huggingface.co/oauth/token", {
|
| 35 |
method: "POST",
|
| 36 |
headers: {
|
|
|
|
| 30 |
const redirect_uri =
|
| 31 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 32 |
url +
|
| 33 |
+
"/deepsite/auth/callback";
|
| 34 |
const request_auth = await fetch("https://huggingface.co/oauth/token", {
|
| 35 |
method: "POST",
|
| 36 |
headers: {
|