LibreChat/api
Ventz Petkov f380f261a5
🛂 fix: OIDC Username Array Edge Case (#2394)
* Patch for OpenID username

`username` is generally based on email, rather than `given_name`. The challenge with `given_name` is that it can be a multi-value array (ex: "Nick, Fullname"), which completely breaks the system with: 

```
LibreChat      | ValidationError: User validation failed: username: Cast to string failed for value "[ 'Nickname', 'Firstname' ]" (type Array) at path "username"
LibreChat      |     at Document.invalidate (/app/node_modules/mongoose/lib/document.js:3200:32)
LibreChat      |     at model.$set (/app/node_modules/mongoose/lib/document.js:1459:12)
LibreChat      |     at model.set [as username] (/app/node_modules/mongoose/lib/helpers/document/compile.js:205:19)
LibreChat      |     at OpenIDConnectStrategy._verify (/app/api/strategies/openidStrategy.js:127:27)
LibreChat      |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
```

* Update openidStrategy.js

* refactor(openidStrategy): add helper function for stringy username

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2024-04-12 12:39:11 -04:00
..
app 🐞 fix: Balance and Token Usage Improvements (#2350) 2024-04-07 23:28:40 -04:00
cache 🎉 feat: Optimizations and Anthropic Title Generation (#2184) 2024-03-23 20:21:40 -04:00
config 🔒 feat: Authenticated Image Requests (#2389) 2024-04-11 02:50:57 -04:00
lib 🔄 refactor: Consolidate Ask/Edit Controllers (#1365) 2023-12-15 15:47:40 -05:00
models 🐞 fix: Balance and Token Usage Improvements (#2350) 2024-04-07 23:28:40 -04:00
server 🔒 feat: Authenticated Image Requests (#2389) 2024-04-11 02:50:57 -04:00
strategies 🛂 fix: OIDC Username Array Edge Case (#2394) 2024-04-12 12:39:11 -04:00
test 🚀 Feat: Streamline File Strategies & GPT-4-Vision Settings (#1535) 2024-01-11 11:37:54 -05:00
utils 🤖 feat: Update Context Limit for gpt-3.5-turbo (#2381) 2024-04-10 15:10:21 -04:00
jest.config.js fix: Enhance Test Coverage and Fix Compatibility Issues 👷‍♂️ (#1363) 2023-12-15 13:27:13 -05:00
jsconfig.json feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
package.json 🧠 feat: Cohere support as Custom Endpoint (#2328) 2024-04-05 15:19:41 -04:00
typedefs.js 🧠 feat: Cohere support as Custom Endpoint (#2328) 2024-04-05 15:19:41 -04:00