mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-06 16:20:19 +01:00
📬 refactor: Normalize Email Handling in User Methods (#10743)
- Updated the `findUser` method to normalize email fields to lowercase and trimmed whitespace for case-insensitive matching. - Enhanced the `normalizeEmailInCriteria` function to handle email normalization in search criteria, including `` conditions. - Added tests to ensure email normalization works correctly across various scenarios, including case differences and whitespace handling.
This commit is contained in:
parent
d7ce19e15a
commit
d5d362e52b
7 changed files with 847 additions and 4 deletions
|
|
@ -172,6 +172,7 @@ describe('socialLogin', () => {
|
|||
|
||||
/** Verify both searches happened */
|
||||
expect(findUser).toHaveBeenNthCalledWith(1, { googleId: googleId });
|
||||
/** Email passed as-is; findUser implementation handles case normalization */
|
||||
expect(findUser).toHaveBeenNthCalledWith(2, { email: email });
|
||||
expect(findUser).toHaveBeenCalledTimes(2);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue