Spaces:
Paused
Paused
extra logs
Browse files
src/routes/login/callback/+page.server.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { base } from "$app/paths";
|
|
| 5 |
import { updateUser } from "./updateUser";
|
| 6 |
import { env } from "$env/dynamic/private";
|
| 7 |
import JSON5 from "json5";
|
|
|
|
| 8 |
|
| 9 |
const allowedUserEmails = z
|
| 10 |
.array(z.string().email())
|
|
@@ -60,6 +61,8 @@ export async function load({ url, locals, cookies, request, getClientAddress })
|
|
| 60 |
}
|
| 61 |
}
|
| 62 |
|
|
|
|
|
|
|
| 63 |
await updateUser({
|
| 64 |
userData,
|
| 65 |
locals,
|
|
|
|
| 5 |
import { updateUser } from "./updateUser";
|
| 6 |
import { env } from "$env/dynamic/private";
|
| 7 |
import JSON5 from "json5";
|
| 8 |
+
import { logger } from "$lib/server/logger";
|
| 9 |
|
| 10 |
const allowedUserEmails = z
|
| 11 |
.array(z.string().email())
|
|
|
|
| 61 |
}
|
| 62 |
}
|
| 63 |
|
| 64 |
+
logger.info("updating user");
|
| 65 |
+
|
| 66 |
await updateUser({
|
| 67 |
userData,
|
| 68 |
locals,
|
src/routes/login/callback/updateUser.ts
CHANGED
|
@@ -79,7 +79,15 @@ export async function updateUser(params: {
|
|
| 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 |
-
logger.info(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
// if using huggingface as auth provider, check orgs for earl access and amin rights
|
| 84 |
const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
|
| 85 |
const isEarlyAccess =
|
|
|
|
| 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 |
+
logger.info(
|
| 83 |
+
{
|
| 84 |
+
login_username: username,
|
| 85 |
+
login_name: name,
|
| 86 |
+
login_email: email,
|
| 87 |
+
login_orgs: orgs?.map((el) => el.sub),
|
| 88 |
+
},
|
| 89 |
+
"user login"
|
| 90 |
+
);
|
| 91 |
// if using huggingface as auth provider, check orgs for earl access and amin rights
|
| 92 |
const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
|
| 93 |
const isEarlyAccess =
|