Spaces:
Paused
Paused
Revert "try(auth): fix early access flagging?"
Browse filesThis reverts commit 2563099b1078c554fe031bc2f6cb67eb039eeac8.
chart/env/prod.yaml
CHANGED
|
@@ -328,8 +328,8 @@ envVars:
|
|
| 328 |
}]
|
| 329 |
WEBSEARCH_BLOCKLIST: '["youtube.com", "twitter.com"]'
|
| 330 |
XFF_DEPTH: '2'
|
| 331 |
-
HF_ORG_ADMIN: 644171cfbd0c97265298aa99
|
| 332 |
-
HF_ORG_EARLY_ACCESS: 5e67bd5b1009063689407478
|
| 333 |
|
| 334 |
infisical:
|
| 335 |
enabled: true
|
|
|
|
| 328 |
}]
|
| 329 |
WEBSEARCH_BLOCKLIST: '["youtube.com", "twitter.com"]'
|
| 330 |
XFF_DEPTH: '2'
|
| 331 |
+
HF_ORG_ADMIN: '644171cfbd0c97265298aa99'
|
| 332 |
+
HF_ORG_EARLY_ACCESS: '5e67bd5b1009063689407478'
|
| 333 |
|
| 334 |
infisical:
|
| 335 |
enabled: true
|
src/routes/login/callback/updateUser.ts
CHANGED
|
@@ -79,16 +79,12 @@ 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 |
// if using huggingface as auth provider, check orgs for earl access and amin rights
|
| 83 |
const isAdmin = (HF_ORG_ADMIN && orgs?.some((org) => org.sub === HF_ORG_ADMIN)) || false;
|
| 84 |
const isEarlyAccess =
|
| 85 |
(HF_ORG_EARLY_ACCESS && orgs?.some((org) => org.sub === HF_ORG_EARLY_ACCESS)) || false;
|
| 86 |
|
| 87 |
-
logger.info(
|
| 88 |
-
{ username, name, email, orgs: orgs?.map((el) => el.sub), isAdmin, isEarlyAccess },
|
| 89 |
-
"user login"
|
| 90 |
-
);
|
| 91 |
-
|
| 92 |
// check if user already exists
|
| 93 |
const existingUser = await collections.users.findOne({ hfUserId });
|
| 94 |
let userId = existingUser?._id;
|
|
|
|
| 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({ username, name, email, orgs: orgs?.map((el) => el.sub) }, "user login");
|
| 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 =
|
| 86 |
(HF_ORG_EARLY_ACCESS && orgs?.some((org) => org.sub === HF_ORG_EARLY_ACCESS)) || false;
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
// check if user already exists
|
| 89 |
const existingUser = await collections.users.findOne({ hfUserId });
|
| 90 |
let userId = existingUser?._id;
|