Skip to content

Conversation

@CrawlerCode
Copy link
Owner

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.

@CrawlerCode CrawlerCode requested a review from Copilot September 9, 2025 19:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@CrawlerCode CrawlerCode merged commit 370208c into main Sep 9, 2025
3 checks passed
@CrawlerCode CrawlerCode deleted the feat/passkeys-support branch September 9, 2025 19:30
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.

1 participant