Spaces:
Running
Running
switch env var
Browse files- app/api/auth/route.ts +2 -2
app/api/auth/route.ts
CHANGED
|
@@ -7,7 +7,7 @@ export async function GET(req: NextRequest) {
|
|
| 7 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 8 |
host +
|
| 9 |
"/auth/callback";
|
| 10 |
-
const loginRedirectUrl = `https://huggingface.co/oauth/authorize?client_id=${process.env.
|
| 11 |
|
| 12 |
return NextResponse.json(
|
| 13 |
{
|
|
@@ -39,7 +39,7 @@ export async function POST(req: NextRequest) {
|
|
| 39 |
}
|
| 40 |
|
| 41 |
const Authorization = `Basic ${Buffer.from(
|
| 42 |
-
`${process.env.
|
| 43 |
).toString("base64")}`;
|
| 44 |
|
| 45 |
const host =
|
|
|
|
| 7 |
`${host.includes("localhost") ? "http://" : "https://"}` +
|
| 8 |
host +
|
| 9 |
"/auth/callback";
|
| 10 |
+
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`;
|
| 11 |
|
| 12 |
return NextResponse.json(
|
| 13 |
{
|
|
|
|
| 39 |
}
|
| 40 |
|
| 41 |
const Authorization = `Basic ${Buffer.from(
|
| 42 |
+
`${process.env.OAUTH_CLIENT_ID}:${process.env.OAUTH_CLIENT_SECRET}`
|
| 43 |
).toString("base64")}`;
|
| 44 |
|
| 45 |
const host =
|