payload-auth 1.6.4 → 1.6.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/better-auth/adapter/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/index.js +19 -16
- package/dist/better-auth/adapter/transform/index.d.ts.map +1 -1
- package/dist/better-auth/adapter/transform/index.js +1 -1
- package/dist/better-auth/adapter/types.d.ts +4 -2
- package/dist/better-auth/adapter/types.d.ts.map +1 -1
- package/dist/better-auth/adapter/types.js +1 -1
- package/dist/better-auth/generated-types.d.ts +110 -46
- package/dist/better-auth/generated-types.d.ts.map +1 -1
- package/dist/better-auth/generated-types.js +1 -1
- package/dist/better-auth/plugin/constants.d.ts +15 -1
- package/dist/better-auth/plugin/constants.d.ts.map +1 -1
- package/dist/better-auth/plugin/constants.js +21 -7
- package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +1 -1
- package/dist/better-auth/plugin/helpers/get-collection.d.ts +1 -1
- package/dist/better-auth/plugin/helpers/get-collection.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/get-collection.js +1 -1
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts +3 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.d.ts.map +1 -0
- package/dist/better-auth/plugin/helpers/get-signed-cookie.js +63 -0
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +7 -7
- package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/prepare-session-data.js +1 -1
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.d.ts.map +1 -1
- package/dist/better-auth/plugin/helpers/sync-resolved-schema-with-collection-map.js +2 -1
- package/dist/better-auth/plugin/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/index.js +6 -3
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +1 -2
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/hooks/get-url-after-read.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +1 -1
- package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/api-keys.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/device-code.js +49 -0
- package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/index.js +6 -2
- package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/jwks.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/members.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +2 -2
- package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/passkeys.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/sessions.js +14 -1
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts +4 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/team-members.js +56 -0
- package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/teams.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/endpoints/refresh-token.js +5 -2
- package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/users/index.js +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts +10 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/filter-properties.js +93 -0
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts +8 -12
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +5 -3
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +6 -7
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +5 -2
- package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/build-collections/verifications.js +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/init-better-auth.js +5 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts +3 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.d.ts.map +1 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/device-authorization-plugin.js +8 -0
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +4 -2
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +9 -3
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.d.ts.map +1 -1
- package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/use-admin-invite-after-email-sign-up-middleware.js +2 -2
- package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-login/index.js +2 -2
- package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/admin-signup/index.js +2 -2
- package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/forgot-password/index.js +2 -2
- package/dist/better-auth/plugin/payload/views/reset-password/client.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/client.js +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/reset-password/index.js +3 -3
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts.map +1 -1
- package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +2 -2
- package/dist/better-auth/plugin/types.d.ts +38 -6
- package/dist/better-auth/plugin/types.d.ts.map +1 -1
- package/dist/better-auth/plugin/types.js +1 -1
- package/dist/better-auth/scripts/generate-types.js +28 -36
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/package.json +12 -43
- package/dist/authjs/index.d.ts +0 -2
- package/dist/authjs/index.d.ts.map +0 -1
- package/dist/authjs/index.js +0 -3
- package/dist/clerk/admin-ui.d.ts +0 -4
- package/dist/clerk/admin-ui.d.ts.map +0 -1
- package/dist/clerk/admin-ui.js +0 -5
- package/dist/clerk/index.d.ts +0 -7
- package/dist/clerk/index.d.ts.map +0 -1
- package/dist/clerk/index.js +0 -8
- package/dist/clerk/plugin/auth-strategy.d.ts +0 -11
- package/dist/clerk/plugin/auth-strategy.d.ts.map +0 -1
- package/dist/clerk/plugin/auth-strategy.js +0 -45
- package/dist/clerk/plugin/collections/users/access.d.ts +0 -14
- package/dist/clerk/plugin/collections/users/access.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/access.js +0 -36
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts +0 -14
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/sync-from-clerk.js +0 -108
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.d.ts +0 -4
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/index.js +0 -5
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.d.ts +0 -13
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userCreated.js +0 -33
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.d.ts +0 -11
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userDeleted.js +0 -27
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.d.ts +0 -13
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/handlers/userUpdated.js +0 -35
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.d.ts +0 -12
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/endpoints/webhook/index.js +0 -87
- package/dist/clerk/plugin/collections/users/fields.d.ts +0 -6
- package/dist/clerk/plugin/collections/users/fields.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/fields.js +0 -81
- package/dist/clerk/plugin/collections/users/index.d.ts +0 -10
- package/dist/clerk/plugin/collections/users/index.d.ts.map +0 -1
- package/dist/clerk/plugin/collections/users/index.js +0 -95
- package/dist/clerk/plugin/components/after-login-form.d.ts +0 -4
- package/dist/clerk/plugin/components/after-login-form.d.ts.map +0 -1
- package/dist/clerk/plugin/components/after-login-form.js +0 -65
- package/dist/clerk/plugin/components/logout-button.d.ts +0 -2
- package/dist/clerk/plugin/components/logout-button.d.ts.map +0 -1
- package/dist/clerk/plugin/components/logout-button.js +0 -49
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts +0 -6
- package/dist/clerk/plugin/components/sync-clerk-users-button.d.ts.map +0 -1
- package/dist/clerk/plugin/components/sync-clerk-users-button.js +0 -75
- package/dist/clerk/plugin.d.ts +0 -6
- package/dist/clerk/plugin.d.ts.map +0 -1
- package/dist/clerk/plugin.js +0 -63
- package/dist/clerk/types.d.ts +0 -63
- package/dist/clerk/types.d.ts.map +0 -1
- package/dist/clerk/types.js +0 -3
- package/dist/clerk/utils/clerk-user.d.ts +0 -21
- package/dist/clerk/utils/clerk-user.d.ts.map +0 -1
- package/dist/clerk/utils/clerk-user.js +0 -45
- package/dist/clerk/utils/index.d.ts +0 -4
- package/dist/clerk/utils/index.d.ts.map +0 -1
- package/dist/clerk/utils/index.js +0 -5
- package/dist/clerk/utils/load-clerk-instance.d.ts +0 -8
- package/dist/clerk/utils/load-clerk-instance.d.ts.map +0 -1
- package/dist/clerk/utils/load-clerk-instance.js +0 -11
- package/dist/clerk/utils/svix.d.ts +0 -9
- package/dist/clerk/utils/svix.d.ts.map +0 -1
- package/dist/clerk/utils/svix.js +0 -40
- package/dist/clerk/utils/user.d.ts +0 -17
- package/dist/clerk/utils/user.d.ts.map +0 -1
- package/dist/clerk/utils/user.js +0 -46
- package/dist/kinde/index.d.ts +0 -2
- package/dist/kinde/index.d.ts.map +0 -1
- package/dist/kinde/index.js +0 -3
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export async function loadClerkInstance() {
|
|
2
|
-
if (typeof window === 'undefined') return;
|
|
3
|
-
if (window.clerkInstance) return window.clerkInstance;
|
|
4
|
-
const { Clerk } = await import("@clerk/clerk-js");
|
|
5
|
-
const clerkInstance = new Clerk(process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY);
|
|
6
|
-
clerkInstance.load();
|
|
7
|
-
window.clerkInstance = clerkInstance;
|
|
8
|
-
return clerkInstance;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGVyay91dGlscy9sb2FkLWNsZXJrLWluc3RhbmNlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQ2xlcmsgfSBmcm9tICdAY2xlcmsvY2xlcmstanMnXG5cbmRlY2xhcmUgZ2xvYmFsIHtcbiAgaW50ZXJmYWNlIFdpbmRvdyB7XG4gICAgY2xlcmtJbnN0YW5jZT86IENsZXJrXG4gIH1cbn1cblxuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGxvYWRDbGVya0luc3RhbmNlKCkge1xuICBpZiAodHlwZW9mIHdpbmRvdyA9PT0gJ3VuZGVmaW5lZCcpIHJldHVyblxuICBpZiAod2luZG93LmNsZXJrSW5zdGFuY2UpIHJldHVybiB3aW5kb3cuY2xlcmtJbnN0YW5jZVxuICBjb25zdCB7IENsZXJrIH0gPSBhd2FpdCBpbXBvcnQoJ0BjbGVyay9jbGVyay1qcycpXG4gIGNvbnN0IGNsZXJrSW5zdGFuY2UgPSBuZXcgQ2xlcmsocHJvY2Vzcy5lbnYuTkVYVF9QVUJMSUNfQ0xFUktfUFVCTElTSEFCTEVfS0VZISlcbiAgY2xlcmtJbnN0YW5jZS5sb2FkKClcbiAgd2luZG93LmNsZXJrSW5zdGFuY2UgPSBjbGVya0luc3RhbmNlXG4gIHJldHVybiBjbGVya0luc3RhbmNlXG59XG4iXSwibmFtZXMiOlsibG9hZENsZXJrSW5zdGFuY2UiLCJ3aW5kb3ciLCJjbGVya0luc3RhbmNlIiwiQ2xlcmsiLCJwcm9jZXNzIiwiZW52IiwiTkVYVF9QVUJMSUNfQ0xFUktfUFVCTElTSEFCTEVfS0VZIiwibG9hZCJdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxlQUFlQTtJQUNwQixJQUFJLE9BQU9DLFdBQVcsYUFBYTtJQUNuQyxJQUFJQSxPQUFPQyxhQUFhLEVBQUUsT0FBT0QsT0FBT0MsYUFBYTtJQUNyRCxNQUFNLEVBQUVDLEtBQUssRUFBRSxHQUFHLE1BQU0sTUFBTSxDQUFDO0lBQy9CLE1BQU1ELGdCQUFnQixJQUFJQyxNQUFNQyxRQUFRQyxHQUFHLENBQUNDLGlDQUFpQztJQUM3RUosY0FBY0ssSUFBSTtJQUNsQk4sT0FBT0MsYUFBYSxHQUFHQTtJQUN2QixPQUFPQTtBQUNUIn0=
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PayloadRequest } from 'payload';
|
|
2
|
-
/**
|
|
3
|
-
* Validates a webhook request using Svix
|
|
4
|
-
*/
|
|
5
|
-
export declare function validateWebhook({ request, secret }: {
|
|
6
|
-
request: PayloadRequest;
|
|
7
|
-
secret?: string;
|
|
8
|
-
}): Promise<boolean>;
|
|
9
|
-
//# sourceMappingURL=svix.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svix.d.ts","sourceRoot":"","sources":["../../../src/clerk/utils/svix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;GAEG;AACH,wBAAsB,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA2CzH"}
|
package/dist/clerk/utils/svix.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Webhook } from "svix";
|
|
2
|
-
/**
|
|
3
|
-
* Validates a webhook request using Svix
|
|
4
|
-
*/ export async function validateWebhook({ request, secret }) {
|
|
5
|
-
// Verify we have the needed methods on the request
|
|
6
|
-
if (!request.clone || typeof request.clone !== 'function') {
|
|
7
|
-
console.error('Svix validation error: request.clone method not available');
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
const webhookSecret = secret || process.env.CLERK_WEBHOOK_SECRET || process.env.SVIX_WEBHOOK_SECRET;
|
|
11
|
-
if (!webhookSecret) {
|
|
12
|
-
console.warn('Clerk webhook called without Svix validation - not recommended for production');
|
|
13
|
-
return process.env.NODE_ENV !== 'production';
|
|
14
|
-
}
|
|
15
|
-
try {
|
|
16
|
-
const headers = request.headers;
|
|
17
|
-
const svixId = headers.get('svix-id');
|
|
18
|
-
const svixTimestamp = headers.get('svix-timestamp');
|
|
19
|
-
const svixSignature = headers.get('svix-signature');
|
|
20
|
-
if (!svixId || !svixTimestamp || !svixSignature) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
const webhook = new Webhook(webhookSecret);
|
|
24
|
-
const svixHeaders = {
|
|
25
|
-
'svix-id': svixId,
|
|
26
|
-
'svix-timestamp': svixTimestamp,
|
|
27
|
-
'svix-signature': svixSignature
|
|
28
|
-
};
|
|
29
|
-
// Clone the request to avoid consuming the body
|
|
30
|
-
const clonedRequest = request.clone();
|
|
31
|
-
const body = await clonedRequest.text();
|
|
32
|
-
await webhook.verify(body, svixHeaders);
|
|
33
|
-
return true;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
console.error('Svix webhook verification failed:', error);
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=data:application/json;base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LGdCQUFnQkgsUUFBUUUsR0FBRyxDQUFDO1FBQ2xDLE1BQU1FLGdCQUFnQkosUUFBUUUsR0FBRyxDQUFDO1FBRWxDLElBQUksQ0FBQ0QsVUFBVSxDQUFDRSxpQkFBaUIsQ0FBQ0MsZUFBZTtZQUMvQyxPQUFPO1FBQ1Q7UUFFQSxNQUFNQyxVQUFVLElBQUluQixRQUFRTztRQUU1QixNQUFNYSxjQUFjO1lBQ2xCLFdBQVdMO1lBQ1gsa0JBQWtCRTtZQUNsQixrQkFBa0JDO1FBQ3BCO1FBRUEsZ0RBQWdEO1FBQ2hELE1BQU1HLGdCQUFnQm5CLFFBQVFFLEtBQUs7UUFDbkMsTUFBTWtCLE9BQU8sTUFBTUQsY0FBY0UsSUFBSTtRQUVyQyxNQUFNSixRQUFRSyxNQUFNLENBQUNGLE1BQU1GO1FBQzNCLE9BQU87SUFDVCxFQUFFLE9BQU9kLE9BQU87UUFDZEQsUUFBUUMsS0FBSyxDQUFDLHFDQUFxQ0E7UUFDbkQsT0FBTztJQUNUO0FBQ0YifQ==
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User-related utility functions for the Clerk plugin
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Find a user in Payload by their Clerk ID or primary email
|
|
6
|
-
*/
|
|
7
|
-
export declare function findUserFromClerkUser({ payload, userSlug, clerkUser }: {
|
|
8
|
-
payload: any;
|
|
9
|
-
userSlug: string;
|
|
10
|
-
clerkUser: any;
|
|
11
|
-
}): Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* Get a user by their Clerk ID
|
|
14
|
-
* Returns the first user found or null if not found
|
|
15
|
-
*/
|
|
16
|
-
export declare function getUserByClerkId(payload: any, userSlug: string, clerkId: string): Promise<any>;
|
|
17
|
-
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../src/clerk/utils/user.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CAAE,gBAwB/H;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,gBAcrF"}
|
package/dist/clerk/utils/user.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* User-related utility functions for the Clerk plugin
|
|
3
|
-
*/ /**
|
|
4
|
-
* Find a user in Payload by their Clerk ID or primary email
|
|
5
|
-
*/ export async function findUserFromClerkUser({ payload, userSlug, clerkUser }) {
|
|
6
|
-
const primaryEmailObj = clerkUser.email_addresses?.find((email)=>email.id === clerkUser.primary_email_address_id);
|
|
7
|
-
const primaryEmail = primaryEmailObj?.email_address;
|
|
8
|
-
return payload.find({
|
|
9
|
-
collection: userSlug,
|
|
10
|
-
where: {
|
|
11
|
-
or: [
|
|
12
|
-
{
|
|
13
|
-
clerkId: {
|
|
14
|
-
equals: clerkUser.id
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
primaryEmail ? {
|
|
18
|
-
email: {
|
|
19
|
-
equals: primaryEmail
|
|
20
|
-
}
|
|
21
|
-
} : undefined
|
|
22
|
-
].filter(Boolean)
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get a user by their Clerk ID
|
|
28
|
-
* Returns the first user found or null if not found
|
|
29
|
-
*/ export async function getUserByClerkId(payload, userSlug, clerkId) {
|
|
30
|
-
if (!clerkId) return null;
|
|
31
|
-
try {
|
|
32
|
-
const result = await findUserFromClerkUser({
|
|
33
|
-
payload,
|
|
34
|
-
userSlug,
|
|
35
|
-
clerkUser: {
|
|
36
|
-
id: clerkId
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return result.docs.length > 0 ? result.docs[0] : null;
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.error('Error finding user by Clerk ID:', error);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbGVyay91dGlscy91c2VyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVXNlci1yZWxhdGVkIHV0aWxpdHkgZnVuY3Rpb25zIGZvciB0aGUgQ2xlcmsgcGx1Z2luXG4gKi9cblxuLyoqXG4gKiBGaW5kIGEgdXNlciBpbiBQYXlsb2FkIGJ5IHRoZWlyIENsZXJrIElEIG9yIHByaW1hcnkgZW1haWxcbiAqL1xuZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGZpbmRVc2VyRnJvbUNsZXJrVXNlcih7IHBheWxvYWQsIHVzZXJTbHVnLCBjbGVya1VzZXIgfTogeyBwYXlsb2FkOiBhbnk7IHVzZXJTbHVnOiBzdHJpbmc7IGNsZXJrVXNlcjogYW55IH0pIHtcbiAgY29uc3QgcHJpbWFyeUVtYWlsT2JqID0gY2xlcmtVc2VyLmVtYWlsX2FkZHJlc3Nlcz8uZmluZCgoZW1haWw6IGFueSkgPT4gZW1haWwuaWQgPT09IGNsZXJrVXNlci5wcmltYXJ5X2VtYWlsX2FkZHJlc3NfaWQpXG5cbiAgY29uc3QgcHJpbWFyeUVtYWlsID0gcHJpbWFyeUVtYWlsT2JqPy5lbWFpbF9hZGRyZXNzXG5cbiAgcmV0dXJuIHBheWxvYWQuZmluZCh7XG4gICAgY29sbGVjdGlvbjogdXNlclNsdWcsXG4gICAgd2hlcmU6IHtcbiAgICAgIG9yOiBbXG4gICAgICAgIHtcbiA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NBQVMsT0FBTztJQUVyQixJQUFJO1FBQ0YsTUFBTU0sU0FBUyxNQUFNckIsc0JBQXNCO1lBQ3pDQztZQUNBQztZQUNBQyxXQUFXO2dCQUFFSyxJQUFJTztZQUFRO1FBQzNCO1FBQ0EsT0FBT00sT0FBT0MsSUFBSSxDQUFDQyxNQUFNLEdBQUcsSUFBSUYsT0FBT0MsSUFBSSxDQUFDLEVBQUUsR0FBRztJQUNuRCxFQUFFLE9BQU9FLE9BQU87UUFDZEMsUUFBUUQsS0FBSyxDQUFDLG1DQUFtQ0E7UUFDakQsT0FBTztJQUNUO0FBQ0YifQ==
|
package/dist/kinde/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kinde/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,UAAU,CAAA"}
|
package/dist/kinde/index.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export const kinde = 'kinde';
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9raW5kZS9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3Qga2luZGUgPSAna2luZGUnXG4iXSwibmFtZXMiOlsia2luZGUiXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sTUFBTUEsUUFBUSxRQUFPIn0=
|