@delmaredigital/payload-better-auth 0.5.5 → 0.5.6
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/dist/adapter/index.js +5 -5
- package/dist/components/LoginView.js +1 -1
- package/dist/components/PasskeyRegisterButton.js +1 -1
- package/dist/components/PasskeySignInButton.js +1 -1
- package/dist/components/management/ApiKeysManagementClient.js +1 -1
- package/dist/components/management/PasskeysManagementClient.js +1 -1
- package/package.json +1 -1
package/dist/adapter/index.js
CHANGED
|
@@ -147,11 +147,11 @@
|
|
|
147
147
|
const effectiveDbType = adapterConfig.dbType ?? (typeof payloadClient !== 'function' ? detectDbType(payloadClient) : 'postgres');
|
|
148
148
|
const idType = resolveIdType(effectiveDbType, options, adapterConfig.idType);
|
|
149
149
|
const generateId = options.advanced?.database?.generateId;
|
|
150
|
-
// Warn if using number IDs but
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
if (idType === 'number' && generateId !==
|
|
154
|
-
console.warn(
|
|
150
|
+
// Warn if using number IDs but generateId is not set to 'serial'.
|
|
151
|
+
// Without this, Better Auth's factory won't coerce relationship field values to numbers,
|
|
152
|
+
// causing Payload ValidationErrors on create/update (e.g. user: '1' instead of user: 1).
|
|
153
|
+
if (idType === 'number' && generateId !== 'serial') {
|
|
154
|
+
console.warn(`[payload-adapter] Warning: Using SERIAL (number) IDs but \`generateId\` is ${generateId === undefined ? 'not set' : `set to "${generateId}"`}. ` + 'You must set `advanced: { database: { generateId: "serial" } }` in your Better Auth config ' + 'so that relationship field values are correctly coerced to numbers. ' + 'Without this, create/update operations will fail with ValidationErrors.');
|
|
155
155
|
}
|
|
156
156
|
// Warn if modelName appears to be already plural (ends with 's')
|
|
157
157
|
// With usePlural: true, providing 'users' would become 'userss'
|
|
@@ -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(
|
|
51
|
+
const { passkeyClient } = await import('@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(
|
|
36
|
+
const { passkeyClient } = await import('@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(
|
|
34
|
+
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
35
35
|
clientRef.current = createAuthClient({
|
|
36
36
|
plugins: [
|
|
37
37
|
twoFactorClient(),
|
|
@@ -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(
|
|
97
|
+
const { apiKeyClient } = await import('@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(
|
|
26
|
+
const { passkeyClient } = await import('@better-auth/passkey/client');
|
|
27
27
|
clientRef.current = createAuthClient({
|
|
28
28
|
plugins: [
|
|
29
29
|
twoFactorClient(),
|