LibreChat/client/src/components/Auth
catmeme 7aa8d49f3a
🧭 fix: Add Base Path Support for Login/Register and Image Paths (#10116)
* fix: add basePath pattern to support login/register and image paths

* Fix linter errors

* refactor: Update import statements for getBasePath and isEnabled, and add path utility functions with tests

- Refactored imports in addImages.js and StableDiffusion.js to use getBasePath from '@librechat/api'.
- Consolidated isEnabled and getBasePath imports in validateImageRequest.js.
- Introduced new path utility functions in path.ts and corresponding unit tests in path.spec.ts to validate base path extraction logic.

* fix: Update domain server base URL in MarkdownComponents and refactor authentication redirection logic

- Changed the domain server base URL in MarkdownComponents.tsx to use the API base URL.
- Refactored the useAuthRedirect hook to utilize React Router's navigate for redirection instead of window.location, ensuring a smoother SPA experience.
- Added unit tests for the useAuthRedirect hook to verify authentication redirection behavior.

* test: Mock isEnabled in validateImages.spec.js for improved test isolation

- Updated validateImages.spec.js to mock the isEnabled function from @librechat/api, ensuring that tests can run independently of the actual implementation.
- Cleared the DOMAIN_CLIENT environment variable before tests to avoid interference with basePath resolution.

---------

Co-authored-by: Danny Avila <danny@librechat.ai>
2025-11-21 11:25:14 -05:00
..
__tests__ 🔑 feat: SAML authentication (#6169) 2025-05-29 11:00:58 -04:00
ApiErrorWatcher.tsx feat: Auth and User System (#205) 2023-05-07 10:04:51 -07:00
AuthLayout.tsx 📑 refactor: Skip H1 Rendering for Falsy Header Values in AuthLayout (#10606) 2025-11-20 16:57:36 -05:00
BlinkAnimation.tsx ♻️ refactor: Login and Registration component Improvement (#2716) 2024-05-28 08:25:07 -04:00
ErrorMessage.tsx 🎨 refactor: Auth Components UI Consistency (#7651) 2025-06-02 07:49:10 -04:00
Footer.tsx 🤲 a11y: Add landmark to footer, labels updates, and sidebar text contrast (#3630) 2024-08-16 03:27:56 -04:00
index.ts 🔒 feat: Two-Factor Authentication with Backup Codes & QR support (#5685) 2025-02-17 19:09:36 -05:00
Login.tsx 🧭 fix: Add Base Path Support for Login/Register and Image Paths (#10116) 2025-11-21 11:25:14 -05:00
LoginForm.tsx 🌒 refactor: Theme Handling to use isDark Utility (#9405) 2025-09-03 02:56:36 -04:00
Registration.tsx 🧭 fix: Add Base Path Support for Login/Register and Image Paths (#10116) 2025-11-21 11:25:14 -05:00
RequestPasswordReset.tsx 🧭 fix: Add Base Path Support for Login/Register and Image Paths (#10116) 2025-11-21 11:25:14 -05:00
ResetPassword.tsx 🔐 feat: Add Configurable Min. Password Length (#9315) 2025-08-27 16:30:56 -04:00
SocialButton.tsx 🔐 style: update auth and loading screen (#3875) 2024-09-11 09:20:19 -04:00
SocialLoginRender.tsx 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
TwoFactorScreen.tsx 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
VerifyEmail.tsx 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00