enzostvs HF Staff commited on
Commit
8feb641
·
1 Parent(s): a329b36

fix splitting

Browse files
Files changed (2) hide show
  1. app/api/me/route.ts +1 -1
  2. utils/checker/is_admin.ts +1 -1
app/api/me/route.ts CHANGED
@@ -14,7 +14,7 @@ export async function GET() {
14
 
15
  const res = await request.clone().json().catch(() => ({}));
16
  // @ts-ignore
17
- const HF_ADMIN = process?.env?.HF_ADMIN.split(',') ?? []
18
  const is_admin = res?.sub ? HF_ADMIN.includes(res?.sub) : false
19
 
20
  return Response.json(
 
14
 
15
  const res = await request.clone().json().catch(() => ({}));
16
  // @ts-ignore
17
+ const HF_ADMIN = process?.env?.HF_ADMIN?.split(',') ?? []
18
  const is_admin = res?.sub ? HF_ADMIN.includes(res?.sub) : false
19
 
20
  return Response.json(
utils/checker/is_admin.ts CHANGED
@@ -4,7 +4,7 @@ export const isAdmin = async (headers: Headers) => {
4
  const Authorization = headers.get('Authorization') ?? undefined
5
 
6
  // @ts-ignore
7
- const HF_ADMIN = process?.env?.HF_ADMIN.split(',') ?? []
8
 
9
  const userRequest = await fetch("https://huggingface.co/oauth/userinfo", {
10
  method: "GET",
 
4
  const Authorization = headers.get('Authorization') ?? undefined
5
 
6
  // @ts-ignore
7
+ const HF_ADMIN = process?.env?.HF_ADMIN?.split(',') ?? []
8
 
9
  const userRequest = await fetch("https://huggingface.co/oauth/userinfo", {
10
  method: "GET",