feat: Add support for Auth.js passkey provider#45
Merged
Conversation
…ddAuthenticatorButton component
There was a problem hiding this comment.
Pull Request Overview
Introduces passkey (WebAuthn) authentication support for the Auth.js integration in Payload CMS. This enhancement extends the authentication system to support modern passwordless authentication through biometrics and security keys.
- Adds WebAuthn provider type support to login components and admin configuration
- Extends user schema with authenticators field to store WebAuthn credentials
- Implements full Auth.js adapter support for authenticator CRUD operations
Reviewed Changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/payload-authjs/src/constants.ts | Creates centralized constant for Auth.js strategy name |
| packages/payload-authjs/src/payload/AuthjsAuthStrategy.ts | Updates imports to use centralized constants |
| packages/payload-authjs/src/payload/plugin.ts | Adds webauthn to supported provider types filter |
| packages/payload-authjs/src/payload/collection/index.ts | Adds authenticators tab to user collection when WebAuthn is available |
| packages/payload-authjs/src/payload/collection/fields/authenticators.ts | Defines authenticators field schema and admin components |
| packages/payload-authjs/src/components/SignInButton/index.tsx | Adds WebAuthn-specific sign-in logic using next-auth/webauthn |
| packages/payload-authjs/src/components/AddAuthenticatorButton.tsx | Creates admin panel button for registering new authenticators |
| packages/payload-authjs/src/authjs/utils/config.ts | Adds utility to detect WebAuthn provider availability |
| packages/payload-authjs/src/authjs/types.ts | Defines Authenticator interface for type safety |
| packages/payload-authjs/src/authjs/PayloadAdapter.ts | Implements complete authenticator management in Auth.js adapter |
| packages/dev/src/auth/providers/passkeys.ts | Configures passkey provider for development environment |
| packages/dev/src/auth/node.config.ts | Integrates passkey provider into Auth.js configuration |
| packages/dev/src/auth/base.config.ts | Enables WebAuthn experimental feature |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/payload-authjs/src/authjs/PayloadAdapter.ts:1
- The toAdapterUser function excludes 'authenticators' from the transformation, but authenticators are now part of the User type. This could cause authenticator data to be included in the AdapterUser when it should be excluded.
import crypto from "crypto";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for passkey (WebAuthn) authentication in the Auth.js integration for Payload CMS. The main changes include updating the user schema to store authenticators and extending the UI with buttons for passkey registration and sign-in.