[PR #989] [MERGED] feat: add passkeys #1302

Closed
opened 2026-02-26 19:32:41 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/989
Author: @dguyen
Created: 3/6/2024
Status: Merged
Merged: 3/26/2024
Merged by: @dguyen

Base: mainHead: feat/passkey


📝 Commits (10+)

📊 Changes

25 files changed (+1706 additions, -27 deletions)

View changed files

📝 apps/web/package.json (+4 -0)
📝 apps/web/src/app/(dashboard)/settings/security/activity/page.tsx (+5 -6)
📝 apps/web/src/app/(dashboard)/settings/security/page.tsx (+23 -1)
apps/web/src/app/(dashboard)/settings/security/passkeys/create-passkey-dialog.tsx (+235 -0)
apps/web/src/app/(dashboard)/settings/security/passkeys/page.tsx (+33 -0)
apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx (+200 -0)
apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx (+120 -0)
📝 apps/web/src/components/(dashboard)/settings/layout/header.tsx (+9 -2)
📝 apps/web/src/components/forms/signin.tsx (+108 -16)
📝 package-lock.json (+169 -0)
📝 packages/lib/constants/auth.ts (+14 -0)
📝 packages/lib/constants/feature-flags.ts (+2 -1)
📝 packages/lib/next-auth/auth-options.ts (+112 -0)
packages/lib/server-only/auth/create-passkey-registration-options.ts (+58 -0)
packages/lib/server-only/auth/create-passkey-signin-options.ts (+41 -0)
packages/lib/server-only/auth/create-passkey.ts (+106 -0)
packages/lib/server-only/auth/delete-passkey.ts (+41 -0)
packages/lib/server-only/auth/find-passkeys.ts (+71 -0)
packages/lib/server-only/auth/update-passkey.ts (+51 -0)
packages/lib/types/webauthn.ts (+44 -0)

...and 5 more files

📄 Description

Description

Add support to login with passkeys.

Passkeys can be added via the user security settings page.

Note: Currently left out adding the type of authentication method for the 'user security audit logs' because we're using the signIn next-auth event which doesn't appear to provide the context. Will look into it at another time.

Changes Made

  • Add passkeys to login
  • Add passkeys feature flag
  • Add page to manage passkeys
  • Add audit logs relating to passkeys
  • Updated prisma schema to support passkeys & anonymous verification tokens

Testing Performed

To be done.

MacOS:

  • Safari
  • Chrome
  • Firefox

Windows:

  • Chrome [Untested]
  • Firefox [Untested]

Linux:

  • Chrome [Untested]
  • Firefox [Untested]

iOS:

  • Safari

Checklist

  • I have tested these changes locally and they work as expected.

Summary by CodeRabbit

  • New Features
    • Introduced Passkey authentication, including creation, sign-in, and management of passkeys.
    • Added a Passkeys section in Security Settings for managing user passkeys.
    • Implemented UI updates for Passkey authentication, including a new dialog for creating passkeys and a data table for managing them.
    • Enhanced security settings with server-side feature flags to conditionally display new security features.
  • Bug Fixes
    • Improved UI consistency in the Settings Security Activity Page.
    • Updated button styling in the 2FA Recovery Codes component for better visibility.
  • Refactor
    • Streamlined authentication options to include WebAuthn credentials provider.
  • Chores
    • Updated database schema to support passkeys and related functionality.
    • Added new audit log types for passkey-related activities.
    • Enhanced server-only authentication utilities for passkey registration and management.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/989 **Author:** [@dguyen](https://github.com/dguyen) **Created:** 3/6/2024 **Status:** ✅ Merged **Merged:** 3/26/2024 **Merged by:** [@dguyen](https://github.com/dguyen) **Base:** `main` ← **Head:** `feat/passkey` --- ### 📝 Commits (10+) - [`8d7541a`](https://github.com/documenso/documenso/commit/8d7541aa7abc0fe0e6ea280a5442261d60ef8bdd) feat: add passkeys - [`280a258`](https://github.com/documenso/documenso/commit/280a25852925fb15c8236e6b54d9a31fced2c1c1) Merge branch 'main' into feat/passkey - [`b348e3c`](https://github.com/documenso/documenso/commit/b348e3c952b8219c557d91c1d3b6ebb987154b2b) Merge branch 'main' into feat/passkey - [`75319f2`](https://github.com/documenso/documenso/commit/75319f20cbb3feebcfa3cb25e14b536786a8bd37) Merge branch 'main' into feat/passkey - [`034318e`](https://github.com/documenso/documenso/commit/034318e571b36e0ce85868319e62cfb1c4bc7d5d) fix: add passkey loading - [`a802f0b`](https://github.com/documenso/documenso/commit/a802f0bceb434d406949e5887b4b3db3d02cc524) fix: add passkey instruction - [`aa926d6`](https://github.com/documenso/documenso/commit/aa926d6642394dc8350787e7d342df44630eb6da) fix: disable form - [`b22de4b`](https://github.com/documenso/documenso/commit/b22de4bd7111b09cc989e918e9a33c0025629017) fix: refactor - [`e4ad940`](https://github.com/documenso/documenso/commit/e4ad940a06da6548ffd8106fedb31d96c884648a) chore: typo - [`87b7945`](https://github.com/documenso/documenso/commit/87b79451d5a3fddc8b6b81dda11452053d83dcae) fix: add passkey limits ### 📊 Changes **25 files changed** (+1706 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `apps/web/package.json` (+4 -0) 📝 `apps/web/src/app/(dashboard)/settings/security/activity/page.tsx` (+5 -6) 📝 `apps/web/src/app/(dashboard)/settings/security/page.tsx` (+23 -1) ➕ `apps/web/src/app/(dashboard)/settings/security/passkeys/create-passkey-dialog.tsx` (+235 -0) ➕ `apps/web/src/app/(dashboard)/settings/security/passkeys/page.tsx` (+33 -0) ➕ `apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table-actions.tsx` (+200 -0) ➕ `apps/web/src/app/(dashboard)/settings/security/passkeys/user-passkeys-data-table.tsx` (+120 -0) 📝 `apps/web/src/components/(dashboard)/settings/layout/header.tsx` (+9 -2) 📝 `apps/web/src/components/forms/signin.tsx` (+108 -16) 📝 `package-lock.json` (+169 -0) 📝 `packages/lib/constants/auth.ts` (+14 -0) 📝 `packages/lib/constants/feature-flags.ts` (+2 -1) 📝 `packages/lib/next-auth/auth-options.ts` (+112 -0) ➕ `packages/lib/server-only/auth/create-passkey-registration-options.ts` (+58 -0) ➕ `packages/lib/server-only/auth/create-passkey-signin-options.ts` (+41 -0) ➕ `packages/lib/server-only/auth/create-passkey.ts` (+106 -0) ➕ `packages/lib/server-only/auth/delete-passkey.ts` (+41 -0) ➕ `packages/lib/server-only/auth/find-passkeys.ts` (+71 -0) ➕ `packages/lib/server-only/auth/update-passkey.ts` (+51 -0) ➕ `packages/lib/types/webauthn.ts` (+44 -0) _...and 5 more files_ </details> ### 📄 Description ## Description Add support to login with passkeys. Passkeys can be added via the user security settings page. Note: Currently left out adding the type of authentication method for the 'user security audit logs' because we're using the `signIn` next-auth event which doesn't appear to provide the context. Will look into it at another time. ## Changes Made - Add passkeys to login - Add passkeys feature flag - Add page to manage passkeys - Add audit logs relating to passkeys - Updated prisma schema to support passkeys & anonymous verification tokens ## Testing Performed To be done. MacOS: - Safari ✅ - Chrome ✅ - Firefox ✅ Windows: - Chrome [Untested] - Firefox [Untested] Linux: - Chrome [Untested] - Firefox [Untested] iOS: - Safari ✅ ## Checklist <!--- Please check the boxes that apply to this pull request. --> <!--- You can add or remove items as needed. --> - [X] I have tested these changes locally and they work as expected. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced Passkey authentication, including creation, sign-in, and management of passkeys. - Added a Passkeys section in Security Settings for managing user passkeys. - Implemented UI updates for Passkey authentication, including a new dialog for creating passkeys and a data table for managing them. - Enhanced security settings with server-side feature flags to conditionally display new security features. - **Bug Fixes** - Improved UI consistency in the Settings Security Activity Page. - Updated button styling in the 2FA Recovery Codes component for better visibility. - **Refactor** - Streamlined authentication options to include WebAuthn credentials provider. - **Chores** - Updated database schema to support passkeys and related functionality. - Added new audit log types for passkey-related activities. - Enhanced server-only authentication utilities for passkey registration and management. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 19:32:41 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#1302
No description provided.