Skip to content

feat(passkey): allow for attestationType: "direct"#8822

Open
JuanM04 wants to merge 2 commits intobetter-auth:mainfrom
JuanM04:attestationType
Open

feat(passkey): allow for attestationType: "direct"#8822
JuanM04 wants to merge 2 commits intobetter-auth:mainfrom
JuanM04:attestationType

Conversation

@JuanM04
Copy link
Copy Markdown

@JuanM04 JuanM04 commented Mar 29, 2026

Following what's described in #6371 (and old PR #2466), this PR allows for attestationType: "direct". This implies always requesting AAGUID from the passkey provider, since with "none" it sometimes defaulted to 00000000-0000-0000-0000-000000000000.


Summary by cubic

Add support for attestationType: "direct" in passkey registration while keeping the default "none". Added tests to ensure the default and forwarding behavior.

  • New Features
    • Add attestationType?: "none" | "direct" to PasskeyOptions.
    • Forward opts.attestationType to registration; fallback to "none".
    • Document attestationType in docs/plugins/passkey.mdx and add tests for default "none" and "direct".

Written for commit bd57d04. Summary will update on new commits.

@JuanM04 JuanM04 requested a review from Bekacru as a code owner March 29, 2026 00:50
Copilot AI review requested due to automatic review settings March 29, 2026 00:50
@vercel vercel bot temporarily deployed to Preview – better-auth March 29, 2026 00:50 Inactive
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
better-auth Skipped Skipped Mar 29, 2026 0:57am

Request Review

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@JuanM04 is attempting to deploy a commit to the better-auth Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 29, 2026

Open in StackBlitz

@better-auth/api-key

npm i https://pkg.pr.new/@better-auth/api-key@8822

better-auth

npm i https://pkg.pr.new/better-auth@8822

auth

npm i https://pkg.pr.new/auth@8822

@better-auth/core

npm i https://pkg.pr.new/@better-auth/core@8822

@better-auth/drizzle-adapter

npm i https://pkg.pr.new/@better-auth/drizzle-adapter@8822

@better-auth/electron

npm i https://pkg.pr.new/@better-auth/electron@8822

@better-auth/expo

npm i https://pkg.pr.new/@better-auth/expo@8822

@better-auth/i18n

npm i https://pkg.pr.new/@better-auth/i18n@8822

@better-auth/kysely-adapter

npm i https://pkg.pr.new/@better-auth/kysely-adapter@8822

@better-auth/memory-adapter

npm i https://pkg.pr.new/@better-auth/memory-adapter@8822

@better-auth/mongo-adapter

npm i https://pkg.pr.new/@better-auth/mongo-adapter@8822

@better-auth/oauth-provider

npm i https://pkg.pr.new/@better-auth/oauth-provider@8822

@better-auth/passkey

npm i https://pkg.pr.new/@better-auth/passkey@8822

@better-auth/prisma-adapter

npm i https://pkg.pr.new/@better-auth/prisma-adapter@8822

@better-auth/redis-storage

npm i https://pkg.pr.new/@better-auth/redis-storage@8822

@better-auth/scim

npm i https://pkg.pr.new/@better-auth/scim@8822

@better-auth/sso

npm i https://pkg.pr.new/@better-auth/sso@8822

@better-auth/stripe

npm i https://pkg.pr.new/@better-auth/stripe@8822

@better-auth/telemetry

npm i https://pkg.pr.new/@better-auth/telemetry@8822

@better-auth/test-utils

npm i https://pkg.pr.new/@better-auth/test-utils@8822

commit: bd57d04

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

Copy link
Copy Markdown
Contributor

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

Enables configuring WebAuthn attestation conveyance preference for the passkey plugin so relying parties can request "direct" attestation (instead of always using "none"), with corresponding documentation updates.

Changes:

  • Added attestationType?: "none" | "direct" to PasskeyOptions.
  • Forwarded opts.attestationType into generateRegistrationOptions (defaulting to "none").
  • Documented the new attestationType option in the passkey plugin docs.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/passkey/src/types.ts Adds the attestationType option to the plugin configuration type.
packages/passkey/src/routes.ts Uses configured attestationType when generating registration options.
docs/content/docs/plugins/passkey.mdx Documents attestationType and its behavior/default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vercel vercel bot temporarily deployed to Preview – better-auth March 29, 2026 00:57 Inactive
@gustavovalverde gustavovalverde self-assigned this Mar 29, 2026
@gustavovalverde gustavovalverde added the credentials Email/password, magic-link, OTP, phone, username, passkeys label Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

credentials Email/password, magic-link, OTP, phone, username, passkeys

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants