@delmaredigital/payload-better-auth 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/LoginView.js +1 -1
- package/dist/components/PasskeyRegisterButton.js +1 -1
- package/dist/components/PasskeySignInButton.js +1 -1
- package/dist/components/api-key/index.d.ts +9 -0
- package/dist/components/api-key/index.js +7 -0
- package/dist/components/management/ApiKeysManagementClient.js +1 -1
- package/dist/components/management/PasskeysManagementClient.js +1 -1
- package/dist/components/management/index.d.ts +2 -6
- package/dist/components/management/index.js +3 -5
- package/dist/components/passkey/index.d.ts +14 -0
- package/dist/components/passkey/index.js +10 -0
- package/dist/exports/components.d.ts +0 -5
- package/dist/exports/components.js +2 -4
- package/dist/exports/management.d.ts +5 -2
- package/dist/exports/management.js +5 -2
- package/dist/exports/rsc-api-key.d.ts +6 -0
- package/dist/exports/rsc-api-key.js +5 -0
- package/dist/exports/rsc-passkey.d.ts +6 -0
- package/dist/exports/rsc-passkey.js +5 -0
- package/dist/exports/rsc.d.ts +3 -2
- package/dist/exports/rsc.js +3 -2
- package/dist/plugin/index.js +2 -2
- package/package.json +21 -1
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Better Auth adapter and plugins for Payload CMS. Enables seamless integration be
|
|
|
12
12
|
<a href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fdelmaredigital%2Fdd-starter&project-name=my-payload-site&build-command=pnpm%20run%20ci&env=PAYLOAD_SECRET,BETTER_AUTH_SECRET&stores=%5B%7B%22type%22%3A%22integration%22%2C%22protocol%22%3A%22storage%22%2C%22productSlug%22%3A%22neon%22%2C%22integrationSlug%22%3A%22neon%22%7D%2C%7B%22type%22%3A%22blob%22%7D%5D"><img src="https://vercel.com/button" alt="Deploy with Vercel" height="32"></a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
|
-
> **Upgrading to 0.5?** This release requires Better Auth 1.5 and includes breaking changes to client plugins, API key imports, and auth instance types. See the [CHANGELOG](./CHANGELOG.md#
|
|
15
|
+
> **Upgrading to 0.5?** This release requires Better Auth 1.5 and includes breaking changes to client plugins, API key imports, and auth instance types. See the [CHANGELOG](./CHANGELOG.md#054---2026-03-02) for migration instructions.
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -48,7 +48,7 @@ export function LoginView({ authClient: providedClient, logo, title = 'Login', a
|
|
|
48
48
|
const getClient = async ()=>{
|
|
49
49
|
if (providedClient) return providedClient;
|
|
50
50
|
if (clientRef.current) return clientRef.current;
|
|
51
|
-
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
51
|
+
const { passkeyClient } = await import(/* webpackIgnore: true */ '@better-auth/passkey/client');
|
|
52
52
|
clientRef.current = createAuthClient({
|
|
53
53
|
plugins: [
|
|
54
54
|
twoFactorClient(),
|
|
@@ -33,7 +33,7 @@ import { twoFactorClient } from 'better-auth/client/plugins';
|
|
|
33
33
|
async function getClient() {
|
|
34
34
|
if (providedClient) return providedClient;
|
|
35
35
|
if (clientRef.current) return clientRef.current;
|
|
36
|
-
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
36
|
+
const { passkeyClient } = await import(/* webpackIgnore: true */ '@better-auth/passkey/client');
|
|
37
37
|
clientRef.current = createAuthClient({
|
|
38
38
|
plugins: [
|
|
39
39
|
twoFactorClient(),
|
|
@@ -31,7 +31,7 @@ import { twoFactorClient } from 'better-auth/client/plugins';
|
|
|
31
31
|
async function getClient() {
|
|
32
32
|
if (providedClient) return providedClient;
|
|
33
33
|
if (clientRef.current) return clientRef.current;
|
|
34
|
-
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
34
|
+
const { passkeyClient } = await import(/* webpackIgnore: true */ '@better-auth/passkey/client');
|
|
35
35
|
clientRef.current = createAuthClient({
|
|
36
36
|
plugins: [
|
|
37
37
|
twoFactorClient(),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Key Components
|
|
3
|
+
*
|
|
4
|
+
* Requires @better-auth/api-key peer dependency.
|
|
5
|
+
* These are separated from the main /management barrel to avoid
|
|
6
|
+
* webpack resolution errors for consumers without @better-auth/api-key.
|
|
7
|
+
*/
|
|
8
|
+
export type { ApiKeysManagementClientProps } from '../management/ApiKeysManagementClient.js';
|
|
9
|
+
export { ApiKeysManagementClient } from '../management/ApiKeysManagementClient.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Key Components
|
|
3
|
+
*
|
|
4
|
+
* Requires @better-auth/api-key peer dependency.
|
|
5
|
+
* These are separated from the main /management barrel to avoid
|
|
6
|
+
* webpack resolution errors for consumers without @better-auth/api-key.
|
|
7
|
+
*/ export { ApiKeysManagementClient } from '../management/ApiKeysManagementClient.js';
|
|
@@ -94,7 +94,7 @@ import { createAuthClient } from 'better-auth/react';
|
|
|
94
94
|
const getClient = async ()=>{
|
|
95
95
|
if (providedClient) return providedClient;
|
|
96
96
|
if (clientRef.current) return clientRef.current;
|
|
97
|
-
const { apiKeyClient } = await import('@better-auth/api-key/client');
|
|
97
|
+
const { apiKeyClient } = await import(/* webpackIgnore: true */ '@better-auth/api-key/client');
|
|
98
98
|
clientRef.current = createAuthClient({
|
|
99
99
|
plugins: [
|
|
100
100
|
apiKeyClient()
|
|
@@ -23,7 +23,7 @@ import { twoFactorClient } from 'better-auth/client/plugins';
|
|
|
23
23
|
const getClient = async ()=>{
|
|
24
24
|
if (providedClient) return providedClient;
|
|
25
25
|
if (clientRef.current) return clientRef.current;
|
|
26
|
-
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
26
|
+
const { passkeyClient } = await import(/* webpackIgnore: true */ '@better-auth/passkey/client');
|
|
27
27
|
clientRef.current = createAuthClient({
|
|
28
28
|
plugins: [
|
|
29
29
|
twoFactorClient(),
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Management UI Components for Better Auth
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Core client components for security feature management.
|
|
5
|
+
* Passkey and API key components are in their own entry points.
|
|
6
6
|
*/
|
|
7
7
|
export { TwoFactorManagementClient } from './TwoFactorManagementClient.js';
|
|
8
8
|
export type { TwoFactorManagementClientProps } from './TwoFactorManagementClient.js';
|
|
9
|
-
export { ApiKeysManagementClient } from './ApiKeysManagementClient.js';
|
|
10
|
-
export type { ApiKeysManagementClientProps } from './ApiKeysManagementClient.js';
|
|
11
|
-
export { PasskeysManagementClient } from './PasskeysManagementClient.js';
|
|
12
|
-
export type { PasskeysManagementClientProps } from './PasskeysManagementClient.js';
|
|
13
9
|
export { SecurityNavLinks } from './SecurityNavLinks.js';
|
|
14
10
|
export type { SecurityNavLinksProps } from './SecurityNavLinks.js';
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Management UI Components for Better Auth
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*/ // Client components
|
|
4
|
+
* Core client components for security feature management.
|
|
5
|
+
* Passkey and API key components are in their own entry points.
|
|
6
|
+
*/ // Client components (core only)
|
|
7
7
|
export { TwoFactorManagementClient } from './TwoFactorManagementClient.js';
|
|
8
|
-
export { ApiKeysManagementClient } from './ApiKeysManagementClient.js';
|
|
9
|
-
export { PasskeysManagementClient } from './PasskeysManagementClient.js';
|
|
10
8
|
// Nav links (client component)
|
|
11
9
|
export { SecurityNavLinks } from './SecurityNavLinks.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passkey Components
|
|
3
|
+
*
|
|
4
|
+
* Requires @better-auth/passkey peer dependency.
|
|
5
|
+
* These are separated from the main /components barrel to avoid
|
|
6
|
+
* webpack resolution errors for consumers without @better-auth/passkey.
|
|
7
|
+
*/
|
|
8
|
+
export type { PasskeySignInButtonProps } from '../PasskeySignInButton.js';
|
|
9
|
+
export { PasskeySignInButton } from '../PasskeySignInButton.js';
|
|
10
|
+
export type { PasskeyRegisterButtonProps } from '../PasskeyRegisterButton.js';
|
|
11
|
+
export { PasskeyRegisterButton } from '../PasskeyRegisterButton.js';
|
|
12
|
+
export { PasskeysField } from '../management/fields/PasskeysField.js';
|
|
13
|
+
export type { PasskeysManagementClientProps } from '../management/PasskeysManagementClient.js';
|
|
14
|
+
export { PasskeysManagementClient } from '../management/PasskeysManagementClient.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Passkey Components
|
|
3
|
+
*
|
|
4
|
+
* Requires @better-auth/passkey peer dependency.
|
|
5
|
+
* These are separated from the main /components barrel to avoid
|
|
6
|
+
* webpack resolution errors for consumers without @better-auth/passkey.
|
|
7
|
+
*/ export { PasskeySignInButton } from '../PasskeySignInButton.js';
|
|
8
|
+
export { PasskeyRegisterButton } from '../PasskeyRegisterButton.js';
|
|
9
|
+
export { PasskeysField } from '../management/fields/PasskeysField.js';
|
|
10
|
+
export { PasskeysManagementClient } from '../management/PasskeysManagementClient.js';
|
|
@@ -17,9 +17,4 @@ export type { TwoFactorSetupViewProps } from '../components/twoFactor/TwoFactorS
|
|
|
17
17
|
export { TwoFactorSetupView } from '../components/twoFactor/TwoFactorSetupView.js';
|
|
18
18
|
export type { TwoFactorVerifyViewProps } from '../components/twoFactor/TwoFactorVerifyView.js';
|
|
19
19
|
export { TwoFactorVerifyView } from '../components/twoFactor/TwoFactorVerifyView.js';
|
|
20
|
-
export type { PasskeySignInButtonProps } from '../components/PasskeySignInButton.js';
|
|
21
|
-
export { PasskeySignInButton } from '../components/PasskeySignInButton.js';
|
|
22
|
-
export type { PasskeyRegisterButtonProps } from '../components/PasskeyRegisterButton.js';
|
|
23
|
-
export { PasskeyRegisterButton } from '../components/PasskeyRegisterButton.js';
|
|
24
20
|
export { TwoFactorField } from '../components/management/fields/TwoFactorField.js';
|
|
25
|
-
export { PasskeysField } from '../components/management/fields/PasskeysField.js';
|
|
@@ -10,8 +10,6 @@ export { ForgotPasswordView } from '../components/auth/ForgotPasswordView.js';
|
|
|
10
10
|
export { ResetPasswordView } from '../components/auth/ResetPasswordView.js';
|
|
11
11
|
export { TwoFactorSetupView } from '../components/twoFactor/TwoFactorSetupView.js';
|
|
12
12
|
export { TwoFactorVerifyView } from '../components/twoFactor/TwoFactorVerifyView.js';
|
|
13
|
-
export { PasskeySignInButton } from '../components/PasskeySignInButton.js';
|
|
14
|
-
export { PasskeyRegisterButton } from '../components/PasskeyRegisterButton.js';
|
|
15
13
|
// Management UI field wrappers (for Payload ui fields)
|
|
16
|
-
export { TwoFactorField } from '../components/management/fields/TwoFactorField.js';
|
|
17
|
-
|
|
14
|
+
export { TwoFactorField } from '../components/management/fields/TwoFactorField.js'; // Passkey components moved to '@delmaredigital/payload-better-auth/components/passkey'
|
|
15
|
+
// API key components moved to '@delmaredigital/payload-better-auth/components/api-key'
|
|
@@ -3,8 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Client components for managing security features in the Payload admin panel.
|
|
5
5
|
* For server component views, use the './rsc' export.
|
|
6
|
+
*
|
|
7
|
+
* Passkey management: '@delmaredigital/payload-better-auth/components/passkey'
|
|
8
|
+
* API key management: '@delmaredigital/payload-better-auth/components/api-key'
|
|
6
9
|
*/
|
|
7
|
-
export { SecurityNavLinks, TwoFactorManagementClient,
|
|
8
|
-
export type { SecurityNavLinksProps, TwoFactorManagementClientProps,
|
|
10
|
+
export { SecurityNavLinks, TwoFactorManagementClient, } from '../components/management/index.js';
|
|
11
|
+
export type { SecurityNavLinksProps, TwoFactorManagementClientProps, } from '../components/management/index.js';
|
|
9
12
|
export { detectEnabledPlugins } from '../utils/detectEnabledPlugins.js';
|
|
10
13
|
export type { EnabledPluginsResult } from '../utils/detectEnabledPlugins.js';
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Client components for managing security features in the Payload admin panel.
|
|
5
5
|
* For server component views, use the './rsc' export.
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
*
|
|
7
|
+
* Passkey management: '@delmaredigital/payload-better-auth/components/passkey'
|
|
8
|
+
* API key management: '@delmaredigital/payload-better-auth/components/api-key'
|
|
9
|
+
*/ // Client components (core only — no optional peer deps)
|
|
10
|
+
export { SecurityNavLinks, TwoFactorManagementClient } from '../components/management/index.js';
|
|
8
11
|
// Re-export plugin detection utility
|
|
9
12
|
export { detectEnabledPlugins } from '../utils/detectEnabledPlugins.js';
|
package/dist/exports/rsc.d.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These async server components use DefaultTemplate for proper
|
|
5
5
|
* integration with Payload's admin panel layout.
|
|
6
|
+
*
|
|
7
|
+
* Passkey views: '@delmaredigital/payload-better-auth/rsc/passkey'
|
|
8
|
+
* API key views: '@delmaredigital/payload-better-auth/rsc/api-key'
|
|
6
9
|
*/
|
|
7
10
|
export { LoginViewWrapper } from '../components/LoginViewWrapper.js';
|
|
8
11
|
export { TwoFactorView } from '../components/management/views/TwoFactorView.js';
|
|
9
|
-
export { ApiKeysView } from '../components/management/views/ApiKeysView.js';
|
|
10
|
-
export { PasskeysView } from '../components/management/views/PasskeysView.js';
|
package/dist/exports/rsc.js
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* These async server components use DefaultTemplate for proper
|
|
5
5
|
* integration with Payload's admin panel layout.
|
|
6
|
+
*
|
|
7
|
+
* Passkey views: '@delmaredigital/payload-better-auth/rsc/passkey'
|
|
8
|
+
* API key views: '@delmaredigital/payload-better-auth/rsc/api-key'
|
|
6
9
|
*/ export { LoginViewWrapper } from '../components/LoginViewWrapper.js';
|
|
7
10
|
export { TwoFactorView } from '../components/management/views/TwoFactorView.js';
|
|
8
|
-
export { ApiKeysView } from '../components/management/views/ApiKeysView.js';
|
|
9
|
-
export { PasskeysView } from '../components/management/views/PasskeysView.js';
|
package/dist/plugin/index.js
CHANGED
|
@@ -336,7 +336,7 @@ let apiKeyScopesConfig = undefined;
|
|
|
336
336
|
const managementViews = {};
|
|
337
337
|
if (enabledPlugins.hasApiKey) {
|
|
338
338
|
managementViews.securityApiKeys = {
|
|
339
|
-
Component: '@delmaredigital/payload-better-auth/rsc#ApiKeysView',
|
|
339
|
+
Component: '@delmaredigital/payload-better-auth/rsc/api-key#ApiKeysView',
|
|
340
340
|
path: paths.apiKeys
|
|
341
341
|
};
|
|
342
342
|
}
|
|
@@ -373,7 +373,7 @@ let apiKeyScopesConfig = undefined;
|
|
|
373
373
|
label: 'Passkeys',
|
|
374
374
|
admin: {
|
|
375
375
|
components: {
|
|
376
|
-
Field: '@delmaredigital/payload-better-auth/components#PasskeysField'
|
|
376
|
+
Field: '@delmaredigital/payload-better-auth/components/passkey#PasskeysField'
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
379
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@delmaredigital/payload-better-auth",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"description": "Better Auth adapter and plugins for Payload CMS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -56,6 +56,26 @@
|
|
|
56
56
|
"import": "./dist/exports/rsc.js",
|
|
57
57
|
"types": "./dist/exports/rsc.d.ts",
|
|
58
58
|
"default": "./dist/exports/rsc.js"
|
|
59
|
+
},
|
|
60
|
+
"./rsc/passkey": {
|
|
61
|
+
"import": "./dist/exports/rsc-passkey.js",
|
|
62
|
+
"types": "./dist/exports/rsc-passkey.d.ts",
|
|
63
|
+
"default": "./dist/exports/rsc-passkey.js"
|
|
64
|
+
},
|
|
65
|
+
"./rsc/api-key": {
|
|
66
|
+
"import": "./dist/exports/rsc-api-key.js",
|
|
67
|
+
"types": "./dist/exports/rsc-api-key.d.ts",
|
|
68
|
+
"default": "./dist/exports/rsc-api-key.js"
|
|
69
|
+
},
|
|
70
|
+
"./components/passkey": {
|
|
71
|
+
"import": "./dist/components/passkey/index.js",
|
|
72
|
+
"types": "./dist/components/passkey/index.d.ts",
|
|
73
|
+
"default": "./dist/components/passkey/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./components/api-key": {
|
|
76
|
+
"import": "./dist/components/api-key/index.js",
|
|
77
|
+
"types": "./dist/components/api-key/index.d.ts",
|
|
78
|
+
"default": "./dist/components/api-key/index.js"
|
|
59
79
|
}
|
|
60
80
|
},
|
|
61
81
|
"files": [
|