@onmax/nuxt-better-auth 0.0.2-alpha.8 → 0.0.2-alpha.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/dist/module.json +1 -1
- package/dist/module.mjs +25 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -319,6 +319,18 @@ declare module '#nuxt-better-auth' {
|
|
|
319
319
|
${hasHubDb ? `db: typeof import('hub:db')['db']` : ""}
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
+
|
|
323
|
+
// Augment the config module to use the extended ServerAuthContext
|
|
324
|
+
interface _AugmentedServerAuthContext {
|
|
325
|
+
runtimeConfig: RuntimeConfig
|
|
326
|
+
${hasHubDb ? `db: typeof import('hub:db')['db']` : "db: unknown"}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
declare module '@onmax/nuxt-better-auth/config' {
|
|
330
|
+
import type { BetterAuthOptions } from 'better-auth'
|
|
331
|
+
type ServerAuthConfig = Omit<BetterAuthOptions, 'database' | 'secret' | 'baseURL'>
|
|
332
|
+
export function defineServerAuth<T extends ServerAuthConfig>(config: (ctx: _AugmentedServerAuthContext) => T): (ctx: _AugmentedServerAuthContext) => T
|
|
333
|
+
}
|
|
322
334
|
`
|
|
323
335
|
});
|
|
324
336
|
addTypeTemplate({
|
|
@@ -333,13 +345,25 @@ declare module '#nuxt-better-auth' {
|
|
|
333
345
|
addTypeTemplate({
|
|
334
346
|
filename: "types/nuxt-better-auth-nitro.d.ts",
|
|
335
347
|
getContents: () => `
|
|
348
|
+
declare module 'nitropack' {
|
|
349
|
+
interface NitroRouteRules {
|
|
350
|
+
auth?: import('${resolver.resolve("./runtime/types")}').AuthMeta
|
|
351
|
+
}
|
|
352
|
+
interface NitroRouteConfig {
|
|
353
|
+
auth?: import('${resolver.resolve("./runtime/types")}').AuthMeta
|
|
354
|
+
}
|
|
355
|
+
}
|
|
336
356
|
declare module 'nitropack/types' {
|
|
337
357
|
interface NitroRouteRules {
|
|
338
358
|
auth?: import('${resolver.resolve("./runtime/types")}').AuthMeta
|
|
339
359
|
}
|
|
360
|
+
interface NitroRouteConfig {
|
|
361
|
+
auth?: import('${resolver.resolve("./runtime/types")}').AuthMeta
|
|
362
|
+
}
|
|
340
363
|
}
|
|
364
|
+
export {}
|
|
341
365
|
`
|
|
342
|
-
});
|
|
366
|
+
}, { nuxt: true, nitro: true, node: true });
|
|
343
367
|
nuxt.hook("builder:watch", async (_event, relativePath) => {
|
|
344
368
|
if (relativePath.includes("auth.config")) {
|
|
345
369
|
await updateTemplates({ filter: (t) => t.filename.includes("nuxt-better-auth") });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onmax/nuxt-better-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.2-alpha.
|
|
4
|
+
"version": "0.0.2-alpha.9",
|
|
5
5
|
"packageManager": "pnpm@10.15.1",
|
|
6
6
|
"description": "Nuxt module for Better Auth integration with NuxtHub, route protection, session management, and role-based access",
|
|
7
7
|
"author": "onmax",
|