@nuxtjs/better-auth 0.3.13 → 0.3.15
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 +5 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +117 -12
- package/dist/runtime/app/components/BetterAuthState.d.vue.ts +12 -10
- package/dist/runtime/app/components/BetterAuthState.vue.d.ts +12 -10
- package/dist/runtime/server/utils/auth.js +11 -10
- package/dist/runtime/server/virtual-modules.d.ts +1 -0
- package/dist/runtime/test-utils/server/handler.js +3 -2
- package/package.json +34 -34
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# `@nuxtjs/better-auth`
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@nuxtjs/better-auth)
|
|
4
|
+
[](https://www.npmjs.com/package/@nuxtjs/better-auth)
|
|
5
|
+
[](https://github.com/nuxt-modules/better-auth/blob/main/LICENSE)
|
|
6
|
+
[](https://better-auth.nuxt.dev)
|
|
7
|
+
|
|
3
8
|
Nuxt module for [Better Auth](https://better-auth.com) with Nuxt-native route protection, SSR-safe session access, auto-imported helpers, and optional NuxtHub-backed schema generation.
|
|
4
9
|
|
|
5
10
|
## Who this is for
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
1
|
+
import { existsSync, readFileSync, statSync, readdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { readFile, mkdir, writeFile, rename, rm } from 'node:fs/promises';
|
|
3
3
|
import { getLayerDirectories, resolveServerVariant, hasNuxtCompatibility, hasNuxtModuleCompatibility, addTypeTemplate, updateTemplates, addServerImports, addServerHandler, addNitroPlugin, addImports, addPlugin, addComponentsDir, addRouteMiddleware, extendPages, addTemplate, hasNuxtModule, defineNuxtModule, createResolver, getNitroVersion } from '@nuxt/kit';
|
|
4
4
|
import { consola as consola$1 } from 'consola';
|
|
5
5
|
import { defineDiagnostics, Diagnostic, formatDiagnostic } from 'nostics';
|
|
@@ -8,12 +8,12 @@ import { createRequire } from 'node:module';
|
|
|
8
8
|
import { join as join$1 } from 'node:path';
|
|
9
9
|
import { defu } from 'defu';
|
|
10
10
|
import { toRouteMatcher, createRouter } from 'radix3';
|
|
11
|
-
import { randomBytes } from 'node:crypto';
|
|
11
|
+
import { createHash, randomUUID, randomBytes } from 'node:crypto';
|
|
12
12
|
import { isCI, isTest } from 'std-env';
|
|
13
13
|
import { isInternalAssetPath } from '../dist/runtime/internal/auth-route-rules.js';
|
|
14
14
|
export { defineClientAuth, defineServerAuth } from '../dist/runtime/config.js';
|
|
15
15
|
|
|
16
|
-
const version = "0.3.
|
|
16
|
+
const version = "0.3.15";
|
|
17
17
|
|
|
18
18
|
const CONFIG_EXTENSIONS = [".ts", ".js", ".mts", ".cts", ".mjs", ".cjs"];
|
|
19
19
|
const CONFIG_EXTENSION_RE = /\.[cm]?[jt]s$/;
|
|
@@ -488,10 +488,10 @@ function dialectToProvider(dialect) {
|
|
|
488
488
|
}
|
|
489
489
|
const EXACT_VERSION_RE = /^\d+\.\d+\.\d+(?:-[\w.]+)?$/;
|
|
490
490
|
const LOCKFILES = [["pnpm-lock.yaml", "pnpm"], ["yarn.lock", "yarn"], ["bun.lock", "bun"], ["bun.lockb", "bun"], ["package-lock.json", "npm"]];
|
|
491
|
-
function
|
|
491
|
+
function findInstalledPackage(name, parent) {
|
|
492
492
|
let entry;
|
|
493
493
|
try {
|
|
494
|
-
entry = createRequire(
|
|
494
|
+
entry = createRequire(parent).resolve(name === "auth" ? "auth/api" : name);
|
|
495
495
|
} catch {
|
|
496
496
|
return void 0;
|
|
497
497
|
}
|
|
@@ -501,9 +501,12 @@ function readInstalledPackage(name) {
|
|
|
501
501
|
continue;
|
|
502
502
|
const pkg = JSON.parse(readFileSync(file, "utf8"));
|
|
503
503
|
if (pkg.name === name)
|
|
504
|
-
return pkg;
|
|
504
|
+
return { dir, pkg };
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
+
function readInstalledPackage(name) {
|
|
508
|
+
return findInstalledPackage(name, import.meta.url)?.pkg;
|
|
509
|
+
}
|
|
507
510
|
function devInstallCommand(spec, rootDir) {
|
|
508
511
|
const agent = process.env.npm_config_user_agent?.split("/")[0];
|
|
509
512
|
const manager = LOCKFILES.find(([file]) => existsSync(join(rootDir, file)))?.[1] ?? LOCKFILES.find(([, name]) => name === agent)?.[1] ?? "npm";
|
|
@@ -520,8 +523,7 @@ function checkBetterAuthCli(rootDir, readPackage = readInstalledPackage) {
|
|
|
520
523
|
return { warn: diagnostics.NUXT_AUTH_CLI_VERSION_MISMATCH({ cliVersion: cli.version ?? cliBetterAuthVersion, cliBetterAuthVersion, betterAuthVersion, command: devInstallCommand(spec, rootDir) }) };
|
|
521
524
|
return {};
|
|
522
525
|
}
|
|
523
|
-
|
|
524
|
-
const { generateDrizzleSchema: generateDrizzleSchema2 } = await import('auth/api');
|
|
526
|
+
function resolveDrizzleSchemaInput(authOptions, dialect, schemaOptions) {
|
|
525
527
|
const provider = dialectToProvider(dialect);
|
|
526
528
|
const options = {
|
|
527
529
|
...authOptions,
|
|
@@ -542,6 +544,11 @@ async function generateDrizzleSchema(authOptions, dialect, schemaOptions) {
|
|
|
542
544
|
adapterConfig: { usePlural: schemaOptions?.usePlural ?? false }
|
|
543
545
|
}
|
|
544
546
|
};
|
|
547
|
+
return { options, adapter };
|
|
548
|
+
}
|
|
549
|
+
async function generateDrizzleSchema(authOptions, dialect, schemaOptions) {
|
|
550
|
+
const { generateDrizzleSchema: generateDrizzleSchema2 } = await import('auth/api');
|
|
551
|
+
const { options, adapter } = resolveDrizzleSchemaInput(authOptions, dialect, schemaOptions);
|
|
545
552
|
const result = await generateDrizzleSchema2({
|
|
546
553
|
adapter,
|
|
547
554
|
options
|
|
@@ -551,6 +558,94 @@ async function generateDrizzleSchema(authOptions, dialect, schemaOptions) {
|
|
|
551
558
|
}
|
|
552
559
|
return result.code;
|
|
553
560
|
}
|
|
561
|
+
const SCHEMA_CACHE_REVISION = 1;
|
|
562
|
+
const SCHEMA_GENERATOR_PACKAGES = ["auth", "better-auth", "@better-auth/core", "prettier"];
|
|
563
|
+
function hashPackageContents(dir) {
|
|
564
|
+
const hash = createHash("sha256");
|
|
565
|
+
function visit(relativeDir) {
|
|
566
|
+
const entries = readdirSync(join(dir, relativeDir), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
567
|
+
for (const entry of entries) {
|
|
568
|
+
if (entry.name === "node_modules" || entry.name === ".git")
|
|
569
|
+
continue;
|
|
570
|
+
const relativePath = join(relativeDir, entry.name);
|
|
571
|
+
if (entry.isDirectory()) {
|
|
572
|
+
visit(relativePath);
|
|
573
|
+
} else {
|
|
574
|
+
hash.update(relativePath).update("\0");
|
|
575
|
+
hash.update(createHash("sha256").update(readFileSync(join(dir, relativePath))).digest());
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
visit("");
|
|
580
|
+
return hash.digest("hex");
|
|
581
|
+
}
|
|
582
|
+
function getSchemaGeneratorIdentity() {
|
|
583
|
+
const authApi = createRequire(import.meta.url).resolve("auth/api");
|
|
584
|
+
const generatorHash = createHash("sha256").update(readFileSync(authApi)).digest("hex");
|
|
585
|
+
const packages = SCHEMA_GENERATOR_PACKAGES.map((name) => {
|
|
586
|
+
const installed = findInstalledPackage(name, authApi);
|
|
587
|
+
const contentHash = installed && (name === "better-auth" || name === "@better-auth/core") ? hashPackageContents(installed.dir) : "";
|
|
588
|
+
return `${name}@${installed?.pkg.version} ${installed?.dir} ${contentHash}`;
|
|
589
|
+
});
|
|
590
|
+
return [`revision ${SCHEMA_CACHE_REVISION}`, generatorHash, ...packages];
|
|
591
|
+
}
|
|
592
|
+
function tagSchemaValue(_key, value) {
|
|
593
|
+
switch (typeof value) {
|
|
594
|
+
case "string":
|
|
595
|
+
return `s:${value}`;
|
|
596
|
+
case "number":
|
|
597
|
+
return Number.isFinite(value) ? value : `n:${value}`;
|
|
598
|
+
case "bigint":
|
|
599
|
+
return `b:${value}`;
|
|
600
|
+
case "function":
|
|
601
|
+
return `f:${String(value)}`;
|
|
602
|
+
case "symbol":
|
|
603
|
+
return `y:${String(value)}`;
|
|
604
|
+
case "undefined":
|
|
605
|
+
return "u:";
|
|
606
|
+
default:
|
|
607
|
+
return value;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
async function getDrizzleSchemaKey(authOptions, dialect, schemaOptions) {
|
|
611
|
+
const { getAuthTables } = await import('better-auth/db');
|
|
612
|
+
const { options, adapter } = resolveDrizzleSchemaInput(authOptions, dialect, schemaOptions);
|
|
613
|
+
try {
|
|
614
|
+
const input = JSON.stringify([getAuthTables(options), options.advanced?.database?.generateId, adapter.options, getSchemaGeneratorIdentity()], tagSchemaValue);
|
|
615
|
+
return createHash("sha256").update(input).digest("hex");
|
|
616
|
+
} catch {
|
|
617
|
+
return void 0;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
async function readCachedSchema(cacheFile, key) {
|
|
621
|
+
try {
|
|
622
|
+
const entry = JSON.parse(await readFile(cacheFile, "utf8"));
|
|
623
|
+
return entry.key === key && typeof entry.code === "string" ? entry.code : void 0;
|
|
624
|
+
} catch {
|
|
625
|
+
return void 0;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
async function writeCachedSchema(cacheFile, key, code) {
|
|
629
|
+
const tempFile = `${cacheFile}.${randomUUID()}.tmp`;
|
|
630
|
+
try {
|
|
631
|
+
await mkdir(dirname(cacheFile), { recursive: true });
|
|
632
|
+
await writeFile(tempFile, JSON.stringify({ key, code }));
|
|
633
|
+
await rename(tempFile, cacheFile);
|
|
634
|
+
} catch {
|
|
635
|
+
await rm(tempFile, { force: true }).catch(() => {
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
async function generateCachedDrizzleSchema(authOptions, dialect, schemaOptions, cacheFile) {
|
|
640
|
+
const key = await getDrizzleSchemaKey(authOptions, dialect, schemaOptions);
|
|
641
|
+
const cached = key && await readCachedSchema(cacheFile, key);
|
|
642
|
+
if (cached)
|
|
643
|
+
return cached;
|
|
644
|
+
const code = await generateDrizzleSchema(authOptions, dialect, schemaOptions);
|
|
645
|
+
if (key)
|
|
646
|
+
await writeCachedSchema(cacheFile, key, code);
|
|
647
|
+
return code;
|
|
648
|
+
}
|
|
554
649
|
function loadLocalEnv(rootDir) {
|
|
555
650
|
if (!rootDir)
|
|
556
651
|
return;
|
|
@@ -713,7 +808,8 @@ async function setupBetterAuthSchema(nuxt, serverConfigPath, options, consola, h
|
|
|
713
808
|
};
|
|
714
809
|
const hubCasing = getHubCasing(hub);
|
|
715
810
|
const schemaOptions = { ...options.schema, useUuid: userConfig.advanced?.database?.generateId === "uuid", casing: options.schema?.casing ?? hubCasing };
|
|
716
|
-
const
|
|
811
|
+
const schemaCacheFile = join(nuxt.options.buildDir, "cache", "better-auth", `schema.${dialect}.json`);
|
|
812
|
+
const schemaCode = await generateCachedDrizzleSchema(authOptions, dialect, schemaOptions, schemaCacheFile);
|
|
717
813
|
const { getAuthTables } = await import('better-auth/db');
|
|
718
814
|
const { initGetModelName } = await import('better-auth/adapters');
|
|
719
815
|
const authTables = getAuthTables(authOptions);
|
|
@@ -966,7 +1062,8 @@ function getCloudflareContext(event) {
|
|
|
966
1062
|
|
|
967
1063
|
function resolveHyperdrive(event) {
|
|
968
1064
|
const cloudflareEnv = getCloudflareContext(event)?.env
|
|
969
|
-
|
|
1065
|
+
const runtimeEnv = event?.req?.runtime?.cloudflare?.env
|
|
1066
|
+
return cloudflareEnv?.POSTGRES || runtimeEnv?.POSTGRES || process.env.POSTGRES || globalThis.__env__?.POSTGRES || globalThis.POSTGRES
|
|
970
1067
|
}
|
|
971
1068
|
|
|
972
1069
|
function scheduleCleanup(event, cleanup) {
|
|
@@ -1008,6 +1105,11 @@ function registerClientCleanup(event, client) {
|
|
|
1008
1105
|
response.once('close', cleanup)
|
|
1009
1106
|
}
|
|
1010
1107
|
|
|
1108
|
+
// Hyperdrive clients belong to one request; any other database is shared by the whole process.
|
|
1109
|
+
export function isRequestScopedDatabase(event) {
|
|
1110
|
+
return Boolean(resolveHyperdrive(event)?.connectionString)
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1011
1113
|
export function createDatabase(event) {
|
|
1012
1114
|
const hyperdrive = resolveHyperdrive(event)
|
|
1013
1115
|
if (!hyperdrive?.connectionString)
|
|
@@ -1045,10 +1147,12 @@ import * as schema from './schema.${input.hubDialect}.mjs'
|
|
|
1045
1147
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
|
1046
1148
|
const rawDialect = '${input.hubDialect}'
|
|
1047
1149
|
const dialect = rawDialect === 'postgresql' ? 'pg' : rawDialect
|
|
1150
|
+
export function isRequestScopedDatabase() { return false }
|
|
1048
1151
|
export function createDatabase() { return drizzleAdapter(db, { provider: dialect, schema, usePlural: ${input.usePlural}, camelCase: ${input.camelCase} }) }
|
|
1049
1152
|
export { db }`;
|
|
1050
1153
|
}
|
|
1051
|
-
return `export function
|
|
1154
|
+
return `export function isRequestScopedDatabase() { return false }
|
|
1155
|
+
export function createDatabase() { return undefined }
|
|
1052
1156
|
export const db = undefined`;
|
|
1053
1157
|
}
|
|
1054
1158
|
function buildSchemaExportCode(hasHubDb, hubDialect, modelNames = {}) {
|
|
@@ -1330,6 +1434,7 @@ type AvailableRouterMethod<_ReqT extends NitroFetchRequest> = 'get' | 'head' | '
|
|
|
1330
1434
|
declare module '#auth/database' {
|
|
1331
1435
|
import type { BetterAuthOptions } from 'better-auth'
|
|
1332
1436
|
export function createDatabase(event?: import('${h3TypesPath}').H3Event): BetterAuthOptions['database']
|
|
1437
|
+
export function isRequestScopedDatabase(event?: import('${h3TypesPath}').H3Event): boolean
|
|
1333
1438
|
export const db: ${hasHubDb ? `typeof import('@nuxthub/db')['db']` : "undefined"}
|
|
1334
1439
|
}
|
|
1335
1440
|
`
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {
|
|
4
|
+
loggedIn: boolean;
|
|
5
|
+
user: import("../../types.js").AuthUser | null;
|
|
6
|
+
session: import("../../types.js").ClientAuthSession | null;
|
|
7
|
+
signOut: (options?: import("../composables/useUserSession.js").SignOutOptions) => Promise<void>;
|
|
8
|
+
}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
placeholder?: (props: {}) => any;
|
|
11
|
+
};
|
|
11
12
|
};
|
|
13
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} & {
|
|
10
|
-
|
|
1
|
+
declare const __VLS_template: () => {
|
|
2
|
+
__VLS_Slots: {
|
|
3
|
+
default?: (props: {
|
|
4
|
+
loggedIn: boolean;
|
|
5
|
+
user: import("../../types.js").AuthUser | null;
|
|
6
|
+
session: import("../../types.js").ClientAuthSession | null;
|
|
7
|
+
signOut: (options?: import("../composables/useUserSession.js").SignOutOptions) => Promise<void>;
|
|
8
|
+
}) => any;
|
|
9
|
+
} & {
|
|
10
|
+
placeholder?: (props: {}) => any;
|
|
11
|
+
};
|
|
11
12
|
};
|
|
13
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
13
15
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
14
16
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { betterAuth, env } from "better-auth";
|
|
2
|
-
import { createDatabase, db } from "#auth/database";
|
|
2
|
+
import { createDatabase, db, isRequestScopedDatabase } from "#auth/database";
|
|
3
3
|
import createServerAuth from "#auth/server";
|
|
4
4
|
import { getConfiguredAuthSecret, getDerivedAuthSecret, hasExplicitAuthSecret, prepareAuthSecret } from "../internal/auth-secret.js";
|
|
5
5
|
import { getRequestHost, getRequestProtocol, useRuntimeConfig } from "../internal/nitro-compat.js";
|
|
@@ -248,6 +248,15 @@ export function serverAuth(event) {
|
|
|
248
248
|
const requestContext = event ? getRequestAuthContext(event) : void 0;
|
|
249
249
|
if (requestContext?.[requestAuthKey])
|
|
250
250
|
return requestContext[requestAuthKey];
|
|
251
|
+
const requestScopedDatabase = isRequestScopedDatabase(event);
|
|
252
|
+
if (!requestScopedDatabase) {
|
|
253
|
+
const cached = _authCache.get(cacheKey);
|
|
254
|
+
if (cached) {
|
|
255
|
+
if (requestContext)
|
|
256
|
+
requestContext[requestAuthKey] = cached;
|
|
257
|
+
return cached;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
251
260
|
userConfig ??= createServerAuth({ runtimeConfig, db, requestOrigin });
|
|
252
261
|
const usesDerivedSecret = derived.available && userConfig.secrets === void 0 && !hasExplicitAuthSecret(runtimeConfig);
|
|
253
262
|
const derivedSecretMissing = usesDerivedSecret && !derived.secret;
|
|
@@ -276,15 +285,7 @@ export function serverAuth(event) {
|
|
|
276
285
|
console.warn('[nuxt-better-auth] rateLimit.storage: "secondary-storage" requires secondaryStorage. Falling back to process-local memory. Set rateLimit.storage to "database" or provide rateLimit.customStorage for shared limits.');
|
|
277
286
|
}
|
|
278
287
|
const rateLimit = useMemoryRateLimit ? { ...userConfig.rateLimit, storage: "memory" } : userConfig.rateLimit;
|
|
279
|
-
const cacheable = !
|
|
280
|
-
if (cacheable) {
|
|
281
|
-
const cached = _authCache.get(cacheKey);
|
|
282
|
-
if (cached) {
|
|
283
|
-
if (requestContext)
|
|
284
|
-
requestContext[requestAuthKey] = cached;
|
|
285
|
-
return cached;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
+
const cacheable = !requestScopedDatabase && !derivedSecretMissing;
|
|
288
289
|
const authOptions = {
|
|
289
290
|
...userConfig,
|
|
290
291
|
...userConfig.plugins ? { plugins: [...userConfig.plugins] } : {},
|
|
@@ -10,9 +10,10 @@ const requestSchema = z.discriminatedUnion("action", [
|
|
|
10
10
|
const ownedUsers = /* @__PURE__ */ new Set();
|
|
11
11
|
export default defineEventHandler(async (event) => {
|
|
12
12
|
const token = useRuntimeConfig().betterAuthTestToken;
|
|
13
|
-
|
|
13
|
+
const request = toWebRequest(event);
|
|
14
|
+
if (!token || request.headers.get("x-nuxt-auth-test") !== token)
|
|
14
15
|
throw createAuthError(404, "Not found");
|
|
15
|
-
const body = requestSchema.parse(parseJSON(await
|
|
16
|
+
const body = requestSchema.parse(parseJSON(await request.text()));
|
|
16
17
|
const context = await serverAuth(event).$context;
|
|
17
18
|
const test = context.test;
|
|
18
19
|
if (body.action === "createUser") {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/better-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.15",
|
|
5
5
|
"description": "Nuxt module for Better Auth integration with NuxtHub, route protection, session management, and role-based access",
|
|
6
6
|
"author": "onmax",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@nuxt/test-utils": "^4.1.0",
|
|
63
63
|
"@nuxthub/core": ">=0.10.5",
|
|
64
|
-
"auth": "1.7.
|
|
64
|
+
"auth": "1.7.18",
|
|
65
65
|
"better-auth": ">=1.7.3 <2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
@@ -76,58 +76,58 @@
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"@nuxt/devtools-kit": "^
|
|
80
|
-
"@nuxt/kit": "^4.6.
|
|
81
|
-
"@types/node": "^
|
|
79
|
+
"@nuxt/devtools-kit": "^4.0.0",
|
|
80
|
+
"@nuxt/kit": "^4.6.2",
|
|
81
|
+
"@types/node": "^26.0.0",
|
|
82
82
|
"consola": "^3.4.2",
|
|
83
83
|
"cookie-es": "^3.1.1",
|
|
84
84
|
"defu": "^6.1.7",
|
|
85
85
|
"get-port-please": "^3.2.0",
|
|
86
|
-
"h3": "^2.0.
|
|
86
|
+
"h3": "^2.0.8",
|
|
87
87
|
"jiti": "^2.7.0",
|
|
88
|
-
"nostics": "^1.
|
|
88
|
+
"nostics": "^1.3.0",
|
|
89
89
|
"pathe": "^2.0.3",
|
|
90
90
|
"radix3": "^1.1.2",
|
|
91
|
-
"std-env": "^4.
|
|
91
|
+
"std-env": "^4.3.0",
|
|
92
92
|
"ufo": "^1.6.4",
|
|
93
|
-
"zod": "^4.
|
|
93
|
+
"zod": "^4.6.7"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
96
|
"@antfu/eslint-config": "^10.0.0",
|
|
97
97
|
"@libsql/client": "^0.18.0",
|
|
98
98
|
"@libsql/linux-x64-gnu": "0.5.29",
|
|
99
|
-
"@nuxt/devtools": "^
|
|
99
|
+
"@nuxt/devtools": "^4.0.0",
|
|
100
100
|
"@nuxt/fonts": "1.2.0",
|
|
101
101
|
"@nuxt/module-builder": "^1.0.3",
|
|
102
|
-
"@nuxt/schema": "^4.6.
|
|
103
|
-
"@nuxt/test-utils": "^4.3.
|
|
104
|
-
"@nuxthub/core": "^0.10.
|
|
105
|
-
"@pinia/nuxt": "^1.0.
|
|
102
|
+
"@nuxt/schema": "^4.6.2",
|
|
103
|
+
"@nuxt/test-utils": "^4.3.4",
|
|
104
|
+
"@nuxthub/core": "^0.10.11",
|
|
105
|
+
"@pinia/nuxt": "^1.0.3",
|
|
106
106
|
"@types/better-sqlite3": "^9.6.0",
|
|
107
107
|
"@typescript/typescript6": "6.0.2",
|
|
108
|
-
"@vue/test-utils": "^2.
|
|
109
|
-
"auth": "1.7.
|
|
110
|
-
"better-auth": "1.7.
|
|
111
|
-
"better-call": "1.4.
|
|
112
|
-
"better-sqlite3": "^13.0.
|
|
113
|
-
"drizzle-kit": "^0.31.
|
|
114
|
-
"drizzle-orm": "^0.45.
|
|
115
|
-
"eslint": "^10.
|
|
116
|
-
"happy-dom": "^21.0.
|
|
117
|
-
"nitropack": "2.13.
|
|
118
|
-
"nuxt": "^4.6.
|
|
119
|
-
"pinia": "^4.0
|
|
120
|
-
"pkg-pr-new": "0.0.
|
|
121
|
-
"playwright-core": "1.
|
|
122
|
-
"postgres": "^
|
|
108
|
+
"@vue/test-utils": "^2.5.1",
|
|
109
|
+
"auth": "1.7.18",
|
|
110
|
+
"better-auth": "1.7.18",
|
|
111
|
+
"better-call": "1.4.5",
|
|
112
|
+
"better-sqlite3": "^13.0.3",
|
|
113
|
+
"drizzle-kit": "^0.31.11",
|
|
114
|
+
"drizzle-orm": "^0.45.4",
|
|
115
|
+
"eslint": "^10.13.0",
|
|
116
|
+
"happy-dom": "^21.0.4",
|
|
117
|
+
"nitropack": "2.13.6",
|
|
118
|
+
"nuxt": "^4.6.2",
|
|
119
|
+
"pinia": "^4.1.0",
|
|
120
|
+
"pkg-pr-new": "0.0.93",
|
|
121
|
+
"playwright-core": "1.65.0",
|
|
122
|
+
"postgres": "^4.0.0",
|
|
123
123
|
"typescript": "~7.0.0",
|
|
124
124
|
"typescript-next": "npm:typescript@~7.0.0",
|
|
125
125
|
"unstorage": "^1.17.5",
|
|
126
|
-
"vitest": "^5.0.
|
|
127
|
-
"vue": "3.5.
|
|
128
|
-
"vue-tsc": "^3.3.
|
|
129
|
-
"wrangler": "4.
|
|
130
|
-
"yaml": "^2.9.
|
|
126
|
+
"vitest": "^5.0.5",
|
|
127
|
+
"vue": "3.5.45",
|
|
128
|
+
"vue-tsc": "^3.3.13",
|
|
129
|
+
"wrangler": "4.158.0",
|
|
130
|
+
"yaml": "^2.9.1"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"build": "pnpm build:docs",
|