Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 feat: Add Cloudflare Turnstile support #5987

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 23, 2025

Summary

Closes: #4047
Docs: LibreChat-AI/librechat.ai#245

This pull request introduces several changes to the AppService and its associated test files to include the new turnstileConfig and improve the overall configuration handling. The most important changes include adding the turnstileConfig to the application's local variables, updating the service initialization, and expanding the test coverage to mock and verify the new configuration.

Cloudflare:

Configuration Updates:

  • Added turnstileConfig to the application locals in AppService (api/server/routes/config.js, api/server/services/AppService.js). [1] [2] [3] [4]

Test Enhancements:

  • Expanded the test mocks to include turnstileConfig and other configuration checks in AppService.spec.js (api/server/services/AppService.spec.js). [1] [2] [3]
  • Added tests to verify the correct assignment of turnstileConfig and other configurations in AppService.spec.js (api/server/services/AppService.spec.js). [1] [2] [3]

These changes ensure that the turnstileConfig is properly loaded and available throughout the application, and that the new configuration is thoroughly tested.

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

Please describe your test process and include instructions so that we can reproduce your test. If there are any important variables for your testing configuration, list them here.

Test Configuration:

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

@rubentalstra rubentalstra added the ✨ enhancement New feature or request label Feb 23, 2025
@rubentalstra rubentalstra self-assigned this Feb 23, 2025
Copy link
Contributor

🚨 Unused NPM Packages Detected

The following unused dependencies were found:

📂 Client client/package.json

  • @marsidev/react-turnstile

⚠️ Please remove these unused dependencies to keep your project clean.

@rubentalstra
Copy link
Collaborator Author

no 🙃 need it later in the code.

@rubentalstra rubentalstra changed the title 🚀 feat: Add Cloudflare Turnstile and Google ReCaptcha 🚀 feat: Add Cloudflare Turnstile support Feb 23, 2025
Repository owner deleted a comment from github-actions bot Feb 23, 2025
@rubentalstra rubentalstra changed the title 🚀 feat: Add Cloudflare Turnstile support WIP 🚀 feat: Add Cloudflare Turnstile support Feb 23, 2025
@rubentalstra rubentalstra changed the title WIP 🚀 feat: Add Cloudflare Turnstile support 🚀 feat: Add Cloudflare Turnstile support Feb 24, 2025
@rubentalstra rubentalstra marked this pull request as ready for review February 24, 2025 15:55
@rubentalstra
Copy link
Collaborator Author

login-light
login-dark
register-light
register-dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Integrate Turnstile (Cloudflare’s smart CAPTCHA alternative) to protect login/registration page
1 participant