@delmaredigital/payload-better-auth 0.3.8 → 0.3.9
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/package.json +34 -91
- package/src/adapter/collections.ts +0 -621
- package/src/adapter/index.ts +0 -712
- package/src/components/BeforeLogin.tsx +0 -39
- package/src/components/LoginView.tsx +0 -1516
- package/src/components/LoginViewWrapper.tsx +0 -35
- package/src/components/LogoutButton.tsx +0 -58
- package/src/components/PasskeyRegisterButton.tsx +0 -105
- package/src/components/PasskeySignInButton.tsx +0 -96
- package/src/components/auth/ForgotPasswordView.tsx +0 -274
- package/src/components/auth/ResetPasswordView.tsx +0 -331
- package/src/components/auth/index.ts +0 -8
- package/src/components/management/ApiKeysManagementClient.tsx +0 -988
- package/src/components/management/PasskeysManagementClient.tsx +0 -409
- package/src/components/management/SecurityNavLinks.tsx +0 -117
- package/src/components/management/TwoFactorManagementClient.tsx +0 -560
- package/src/components/management/index.ts +0 -20
- package/src/components/management/views/ApiKeysView.tsx +0 -57
- package/src/components/management/views/PasskeysView.tsx +0 -42
- package/src/components/management/views/TwoFactorView.tsx +0 -42
- package/src/components/management/views/index.ts +0 -10
- package/src/components/twoFactor/TwoFactorSetupView.tsx +0 -515
- package/src/components/twoFactor/TwoFactorVerifyView.tsx +0 -238
- package/src/components/twoFactor/index.ts +0 -8
- package/src/exports/client.ts +0 -77
- package/src/exports/components.ts +0 -30
- package/src/exports/management.ts +0 -25
- package/src/exports/rsc.ts +0 -11
- package/src/generated-types.ts +0 -269
- package/src/index.ts +0 -135
- package/src/plugin/index.ts +0 -834
- package/src/scripts/generate-types.ts +0 -269
- package/src/types/apiKey.ts +0 -63
- package/src/types/betterAuth.ts +0 -253
- package/src/utils/access.ts +0 -410
- package/src/utils/apiKeyAccess.ts +0 -443
- package/src/utils/betterAuthDefaults.ts +0 -102
- package/src/utils/detectAuthConfig.ts +0 -47
- package/src/utils/detectEnabledPlugins.ts +0 -69
- package/src/utils/firstUserAdmin.ts +0 -164
- package/src/utils/generateScopes.ts +0 -150
- package/src/utils/session.ts +0 -91
package/src/index.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @delmare/payload-better-auth
|
|
3
|
-
*
|
|
4
|
-
* Better Auth adapter and plugins for Payload CMS.
|
|
5
|
-
* Enables seamless integration between Better Auth and Payload.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// Adapter
|
|
11
|
-
export { payloadAdapter } from './adapter/index.js'
|
|
12
|
-
export type { PayloadAdapterConfig } from './adapter/index.js'
|
|
13
|
-
|
|
14
|
-
// Collection generator plugin
|
|
15
|
-
export { betterAuthCollections } from './adapter/collections.js'
|
|
16
|
-
export type { BetterAuthCollectionsOptions } from './adapter/collections.js'
|
|
17
|
-
|
|
18
|
-
// Payload plugin and strategy
|
|
19
|
-
export {
|
|
20
|
-
createBetterAuthPlugin,
|
|
21
|
-
betterAuthStrategy,
|
|
22
|
-
resetAuthInstance,
|
|
23
|
-
getApiKeyScopesConfig,
|
|
24
|
-
} from './plugin/index.js'
|
|
25
|
-
export type {
|
|
26
|
-
Auth,
|
|
27
|
-
CreateAuthFunction,
|
|
28
|
-
BetterAuthPluginOptions,
|
|
29
|
-
BetterAuthPluginAdminOptions,
|
|
30
|
-
BetterAuthStrategyOptions,
|
|
31
|
-
} from './plugin/index.js'
|
|
32
|
-
|
|
33
|
-
// Enhanced Better Auth types with inference
|
|
34
|
-
export type {
|
|
35
|
-
BetterAuthReturn,
|
|
36
|
-
PayloadWithAuth,
|
|
37
|
-
PayloadRequestWithBetterAuth,
|
|
38
|
-
CollectionHookWithBetterAuth,
|
|
39
|
-
EndpointWithBetterAuth,
|
|
40
|
-
RoleArray,
|
|
41
|
-
} from './types/betterAuth.js'
|
|
42
|
-
|
|
43
|
-
// Generated schema types
|
|
44
|
-
export type {
|
|
45
|
-
User,
|
|
46
|
-
Session as BetterAuthSession,
|
|
47
|
-
Account,
|
|
48
|
-
Verification,
|
|
49
|
-
Apikey,
|
|
50
|
-
Passkey,
|
|
51
|
-
Organization,
|
|
52
|
-
Member,
|
|
53
|
-
Invitation,
|
|
54
|
-
Team,
|
|
55
|
-
TeamMember,
|
|
56
|
-
TwoFactor,
|
|
57
|
-
BaseUserFields,
|
|
58
|
-
BaseSessionFields,
|
|
59
|
-
BaseAccountFields,
|
|
60
|
-
UserPluginFields,
|
|
61
|
-
SessionPluginFields,
|
|
62
|
-
BetterAuthFullSchema,
|
|
63
|
-
ModelKey,
|
|
64
|
-
PluginId,
|
|
65
|
-
} from './generated-types.js'
|
|
66
|
-
|
|
67
|
-
// API key scope types
|
|
68
|
-
export type {
|
|
69
|
-
ScopeDefinition,
|
|
70
|
-
ApiKeyScopesConfig,
|
|
71
|
-
AvailableScope,
|
|
72
|
-
} from './types/apiKey.js'
|
|
73
|
-
|
|
74
|
-
// Scope utilities
|
|
75
|
-
export {
|
|
76
|
-
generateScopesFromCollections,
|
|
77
|
-
buildAvailableScopes,
|
|
78
|
-
scopesToPermissions,
|
|
79
|
-
} from './utils/generateScopes.js'
|
|
80
|
-
|
|
81
|
-
// Access control utilities
|
|
82
|
-
export {
|
|
83
|
-
normalizeRoles,
|
|
84
|
-
hasAnyRole,
|
|
85
|
-
hasAllRoles,
|
|
86
|
-
hasAdminRoles,
|
|
87
|
-
isAdmin,
|
|
88
|
-
isAdminField,
|
|
89
|
-
isAdminOrSelf,
|
|
90
|
-
canUpdateOwnFields,
|
|
91
|
-
isAuthenticated,
|
|
92
|
-
isAuthenticatedField,
|
|
93
|
-
hasRole,
|
|
94
|
-
hasRoleField,
|
|
95
|
-
requireAllRoles,
|
|
96
|
-
} from './utils/access.js'
|
|
97
|
-
export type {
|
|
98
|
-
RoleCheckConfig,
|
|
99
|
-
SelfAccessConfig,
|
|
100
|
-
FieldUpdateConfig,
|
|
101
|
-
} from './utils/access.js'
|
|
102
|
-
|
|
103
|
-
// API key scope enforcement utilities
|
|
104
|
-
export {
|
|
105
|
-
extractApiKeyFromRequest,
|
|
106
|
-
getApiKeyInfo,
|
|
107
|
-
hasScope,
|
|
108
|
-
hasAnyScope as hasAnyScopeKey,
|
|
109
|
-
hasAllScopes as hasAllScopesKey,
|
|
110
|
-
requireScope,
|
|
111
|
-
requireAnyScope,
|
|
112
|
-
requireAllScopes as requireAllScopesKey,
|
|
113
|
-
allowSessionOrScope,
|
|
114
|
-
allowSessionOrAnyScope,
|
|
115
|
-
validateApiKey,
|
|
116
|
-
} from './utils/apiKeyAccess.js'
|
|
117
|
-
export type {
|
|
118
|
-
ApiKeyInfo,
|
|
119
|
-
ApiKeyAccessConfig,
|
|
120
|
-
} from './utils/apiKeyAccess.js'
|
|
121
|
-
|
|
122
|
-
// Auth config detection utility
|
|
123
|
-
export { detectAuthConfig } from './utils/detectAuthConfig.js'
|
|
124
|
-
export type { AuthDetectionResult } from './utils/detectAuthConfig.js'
|
|
125
|
-
|
|
126
|
-
// Session utilities
|
|
127
|
-
export { getServerSession, getServerUser } from './utils/session.js'
|
|
128
|
-
export type { Session } from './utils/session.js'
|
|
129
|
-
|
|
130
|
-
// First user admin hook utility
|
|
131
|
-
export { firstUserAdminHooks } from './utils/firstUserAdmin.js'
|
|
132
|
-
export type { FirstUserAdminOptions } from './utils/firstUserAdmin.js'
|
|
133
|
-
|
|
134
|
-
// Better Auth defaults utility
|
|
135
|
-
export { withBetterAuthDefaults, apiKeyWithDefaults } from './utils/betterAuthDefaults.js'
|