enzostvs HF staff commited on
Commit
e8af30c
β€’
1 Parent(s): a027412

set lorastudio as primary domain

Browse files
src/routes/api/auth/+server.ts CHANGED
@@ -13,9 +13,9 @@ export async function POST({ request }) {
13
  })
14
  }
15
 
16
- const first_space_host = process.env.SPACE_HOST?.split(',')[0] ?? process.env.SPACE_HOST
17
 
18
- const REDIRECT_URI = `https://${first_space_host}/login/callback`;
19
  const Authorization = `Basic ${Buffer.from(
20
  `${process.env.OAUTH_CLIENT_ID}:${process.env.OAUTH_CLIENT_SECRET}`
21
  ).toString("base64")}`;
 
13
  })
14
  }
15
 
16
+ // const first_space_host = process.env.SPACE_HOST?.split(',')[0] ?? process.env.SPACE_HOST
17
 
18
+ const REDIRECT_URI = `https://lorastudio.co/login/callback`;
19
  const Authorization = `Basic ${Buffer.from(
20
  `${process.env.OAUTH_CLIENT_ID}:${process.env.OAUTH_CLIENT_SECRET}`
21
  ).toString("base64")}`;
src/routes/api/auth/login/+server.ts CHANGED
@@ -2,8 +2,8 @@ import { redirect } from '@sveltejs/kit'
2
  /** @type {import('./$types').RequestHandler} */
3
 
4
  export async function GET() {
5
- const first_space_host = process.env.SPACE_HOST?.split(',')[1] ?? process.env.SPACE_HOST
6
- const REDIRECT_URI = `https://${first_space_host}/login/callback`
7
 
8
  throw redirect(302, `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${REDIRECT_URI}&scope=openid%20profile&state=STATE&response_type=code`)
9
  }
 
2
  /** @type {import('./$types').RequestHandler} */
3
 
4
  export async function GET() {
5
+ // const first_space_host = process.env.SPACE_HOST?.split(',')[1] ?? process.env.SPACE_HOST
6
+ const REDIRECT_URI = `https://lorastudio.co/login/callback`
7
 
8
  throw redirect(302, `https://huggingface.co/oauth/authorize?client_id=${process.env.OAUTH_CLIENT_ID}&redirect_uri=${REDIRECT_URI}&scope=openid%20profile&state=STATE&response_type=code`)
9
  }