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

WIP 🔐 feat: PassKey (#5606) #5832

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

WIP 🔐 feat: PassKey (#5606) #5832

wants to merge 11 commits into from

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 12, 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

Screenshot 2025-02-12 at 22 02 05 Screenshot 2025-02-12 at 22 01 59

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.

* added PassKey authentication.

* fixed issue with test :)

* Delete client/src/components/Auth/AuthLayout.tsx

* fix: conflicted issue
@rubentalstra rubentalstra added the ✨ enhancement New feature or request label Feb 12, 2025
@rubentalstra rubentalstra self-assigned this Feb 12, 2025
Repository owner deleted a comment from github-actions bot Feb 12, 2025
Repository owner deleted a comment from github-actions bot Feb 12, 2025
Repository owner deleted a comment from github-actions bot Feb 12, 2025
Repository owner deleted a comment from github-actions bot Feb 12, 2025
@rubentalstra rubentalstra changed the title 🔐 feat: PassKey (#5606) WIP 🔐 feat: PassKey (#5606) Feb 12, 2025
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.

2 participants