@onmax/nuxt-better-auth 0.0.2-alpha.20 → 0.0.2-alpha.22
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/module.d.mts +35 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +454 -433
- package/dist/runtime/app/composables/useUserSession.d.ts +1 -1
- package/dist/runtime/app/composables/useUserSession.js +70 -7
- package/dist/runtime/app/pages/__better-auth-devtools.vue +2 -2
- package/dist/runtime/config.d.ts +26 -5
- package/dist/runtime/server/api/_better-auth/config.get.d.ts +2 -0
- package/dist/runtime/server/api/_better-auth/config.get.js +7 -2
- package/dist/runtime/server/utils/auth.d.ts +1 -1
- package/dist/runtime/server/utils/auth.js +144 -23
- package/dist/runtime/types/augment.d.ts +1 -1
- package/dist/runtime/types.d.ts +1 -1
- package/package.json +4 -14
- package/dist/runtime/adapters/convex.d.ts +0 -111
- package/dist/runtime/adapters/convex.js +0 -213
package/README.md
CHANGED
package/dist/module.d.mts
CHANGED
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { Nuxt } from '@nuxt/schema';
|
|
2
3
|
import { BetterAuthModuleOptions } from '../dist/runtime/config.js';
|
|
3
4
|
export { BetterAuthModuleOptions, defineClientAuth, defineServerAuth } from '../dist/runtime/config.js';
|
|
4
5
|
import { BetterAuthOptions } from 'better-auth';
|
|
5
6
|
export { Auth, AuthMeta, AuthMode, AuthRouteRules, AuthSession, AuthUser, InferSession, InferUser, RequireSessionOptions, ServerAuthContext, UserMatch } from '../dist/runtime/types.js';
|
|
6
7
|
|
|
8
|
+
interface DefineServerAuthFn {
|
|
9
|
+
(...args: unknown[]): unknown;
|
|
10
|
+
_count: number;
|
|
11
|
+
}
|
|
12
|
+
declare global {
|
|
13
|
+
var defineServerAuth: DefineServerAuthFn | undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type DbDialect = 'sqlite' | 'postgresql' | 'mysql';
|
|
17
|
+
|
|
18
|
+
interface BetterAuthDatabaseProviderBuildContext {
|
|
19
|
+
hubDialect: DbDialect;
|
|
20
|
+
usePlural: boolean;
|
|
21
|
+
camelCase: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface BetterAuthDatabaseProviderSetupContext {
|
|
24
|
+
nuxt: Nuxt;
|
|
25
|
+
options: BetterAuthModuleOptions;
|
|
26
|
+
clientOnly: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface BetterAuthDatabaseProviderEnabledContext extends BetterAuthDatabaseProviderSetupContext {
|
|
29
|
+
hasHubDbAvailable: boolean;
|
|
30
|
+
}
|
|
31
|
+
interface BetterAuthDatabaseProviderDefinition {
|
|
32
|
+
buildDatabaseCode: (ctx: BetterAuthDatabaseProviderBuildContext) => string;
|
|
33
|
+
setup?: (ctx: BetterAuthDatabaseProviderSetupContext) => void | Promise<void>;
|
|
34
|
+
isEnabled?: (ctx: BetterAuthDatabaseProviderEnabledContext) => boolean;
|
|
35
|
+
priority?: number;
|
|
36
|
+
}
|
|
7
37
|
declare module '@nuxt/schema' {
|
|
8
38
|
interface NuxtHooks {
|
|
9
39
|
/**
|
|
@@ -12,6 +42,11 @@ declare module '@nuxt/schema' {
|
|
|
12
42
|
* @param config - Partial config to merge into the auth options
|
|
13
43
|
*/
|
|
14
44
|
'better-auth:config:extend': (config: Partial<BetterAuthOptions>) => void | Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Register or override Better Auth database providers.
|
|
47
|
+
* Providers are auto-selected via `isEnabled` + `priority`.
|
|
48
|
+
*/
|
|
49
|
+
'better-auth:database:providers': (providers: Record<string, BetterAuthDatabaseProviderDefinition>) => void | Promise<void>;
|
|
15
50
|
}
|
|
16
51
|
}
|
|
17
52
|
|
package/dist/module.json
CHANGED