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 PassKey #5606

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 2, 2025

Summary

LibreChat-AI/librechat.ai#215

This pull request adds a new passkey authentication option to the application’s login and registration flows. Users can now authenticate using WebAuthn passkeys as an alternative to traditional email/password and social logins. The key changes include:

  • PasskeyAuth Component:
    A new component that handles both login and registration flows via WebAuthn. This component mimics the existing email input styling from the LoginForm for consistency.

  • Conditional View Toggle:
    The AuthLayout now supports toggling between the standard login/registration forms and the passkey authentication view—all while keeping the same URL (e.g. /login or /register).

  • Back Button Functionality:
    A “Back” button has been added to the PasskeyAuth view, allowing users to return to the standard form if they choose not to use passkey authentication.

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

Test Configuration:

  • Environment: Local development environment
  • Browser: Latest version of Chrome (with WebAuthn support)
  • Backend: Mock responses for WebAuthn challenges were used to simulate authentication flows.

Test Steps:

  1. Navigate to the /login (or /register) page.
  2. Click the "Login with Passkey" (or "Register with Passkey") button.
  3. Verify that the view toggles to the passkey authentication form with the same styling as the standard login form.
  4. Enter an email address and complete the WebAuthn challenge flow.
  5. Confirm that, upon successful authentication, the user is redirected appropriately (to / after login or /login after registration).
  6. Click the "Back to normal login" (or "Back to registration") button and verify that the standard form is displayed again.
  7. Ensure that no unintended side effects occur with existing email/password and social login functionalities.

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.
  • I have made pertinent documentation changes.
  • 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.

@danny-avila
Copy link
Owner

Thanks. The failing test suggests you are incorrectly importing a file, probably due to case sensitivity in linux environment

@rubentalstra
Copy link
Collaborator Author

You're welcome. it is now fixed.

@rubentalstra rubentalstra marked this pull request as draft February 4, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants