Skip to content

Commit

Permalink
debug(auth): debug print orgs
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Jul 30, 2024
1 parent a3f5e2a commit 99168e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/routes/login/callback/updateUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { sha256 } from "$lib/utils/sha256";
import { addWeeks } from "date-fns";
import { OIDConfig } from "$lib/server/auth";
import { HF_ORG_ADMIN, HF_ORG_EARLY_ACCESS } from "$env/static/private";
import { logger } from "$lib/server/logger";

export async function updateUser(params: {
userData: UserinfoResponse;
Expand Down Expand Up @@ -78,6 +79,10 @@ export async function updateUser(params: {
// Dynamically access user data based on NAME_CLAIM from environment
// This approach allows us to adapt to different OIDC providers flexibly.

// sorry for the ugly debug oof
if (username === "nsarrazin") {
logger.debug(orgs, "nsarrazin orgs");
}
// if using huggingface as auth provider, check orgs for earl access and amin rights
const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
const isEarlyAccess =
Expand Down

0 comments on commit 99168e8

Please sign in to comment.