mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-27 12:54:09 +01:00
* Allow setting the claim field to be used when OpenID login is configured * fix(openid): harden getOpenIdEmail and expand test coverage Guard against non-string claim values in getOpenIdEmail to prevent a TypeError crash in isEmailDomainAllowed when domain restrictions are configured. Improve warning messages to name the fallback chain explicitly and distinguish missing vs. non-string claim values. Fix the domain-block error log to record the resolved identifier rather than userinfo.email, which was misleading when OPENID_EMAIL_CLAIM resolved to a different field (e.g. upn). Fix a latent test defect in openIdJwtStrategy.spec.js where the ~/server/services/Config mock exported getCustomConfig instead of getAppConfig, the symbol actually consumed by openidStrategy.js. Add refreshController tests covering the OPENID_EMAIL_CLAIM paths, which were previously untested despite being a stated fix target. Expand JWT strategy tests with null-payload, empty/whitespace OPENID_EMAIL_CLAIM, migration-via-preferred_username, and call-order assertions for the findUser lookup sequence. * test(auth): enhance AuthController and openIdJwtStrategy tests for openidId updates Added a new test in AuthController to verify that the openidId is updated correctly when a migration is triggered during the refresh process. Expanded the openIdJwtStrategy tests to include assertions for the updateUser function, ensuring that the correct parameters are passed when a user is found with a legacy email. This improves test coverage for OpenID-related functionality. --------- Co-authored-by: Danny Avila <danny@librechat.ai> |
||
|---|---|---|
| .. | ||
| appleStrategy.js | ||
| appleStrategy.test.js | ||
| discordStrategy.js | ||
| facebookStrategy.js | ||
| githubStrategy.js | ||
| googleStrategy.js | ||
| index.js | ||
| jwtStrategy.js | ||
| ldapStrategy.js | ||
| ldapStrategy.spec.js | ||
| localStrategy.js | ||
| openIdJwtStrategy.js | ||
| openIdJwtStrategy.spec.js | ||
| openidStrategy.js | ||
| openidStrategy.spec.js | ||
| process.js | ||
| process.test.js | ||
| samlStrategy.js | ||
| samlStrategy.spec.js | ||
| socialLogin.js | ||
| socialLogin.test.js | ||
| validators.js | ||
| validators.spec.js | ||