nsarrazin HF Staff commited on
Commit
46b4c43
·
unverified ·
1 Parent(s): 0ab6df0

debug(auth): debug print orgs

Browse files
src/routes/login/callback/updateUser.ts CHANGED
@@ -10,6 +10,7 @@ import { sha256 } from "$lib/utils/sha256";
10
  import { addWeeks } from "date-fns";
11
  import { OIDConfig } from "$lib/server/auth";
12
  import { HF_ORG_ADMIN, HF_ORG_EARLY_ACCESS } from "$env/static/private";
 
13
 
14
  export async function updateUser(params: {
15
  userData: UserinfoResponse;
@@ -78,6 +79,10 @@ export async function updateUser(params: {
78
  // Dynamically access user data based on NAME_CLAIM from environment
79
  // This approach allows us to adapt to different OIDC providers flexibly.
80
 
 
 
 
 
81
  // if using huggingface as auth provider, check orgs for earl access and amin rights
82
  const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
83
  const isEarlyAccess =
 
10
  import { addWeeks } from "date-fns";
11
  import { OIDConfig } from "$lib/server/auth";
12
  import { HF_ORG_ADMIN, HF_ORG_EARLY_ACCESS } from "$env/static/private";
13
+ import { logger } from "$lib/server/logger";
14
 
15
  export async function updateUser(params: {
16
  userData: UserinfoResponse;
 
79
  // Dynamically access user data based on NAME_CLAIM from environment
80
  // This approach allows us to adapt to different OIDC providers flexibly.
81
 
82
+ // sorry for the ugly debug oof
83
+ if (username === "nsarrazin") {
84
+ logger.debug(orgs, "nsarrazin orgs");
85
+ }
86
  // if using huggingface as auth provider, check orgs for earl access and amin rights
87
  const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
88
  const isEarlyAccess =