@nuxtjs/better-auth 0.1.3 → 0.1.4

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 CHANGED
@@ -4,7 +4,7 @@ Nuxt module for [Better Auth](https://better-auth.com) with Nuxt-native route pr
4
4
 
5
5
  ## Who this is for
6
6
 
7
- Use this module if you want Better Auth in a Nuxt 4 app and you want the Nuxt-specific pieces handled for you:
7
+ Use this module if you want Better Auth in a Nuxt app and you want the Nuxt-specific pieces handled for you:
8
8
 
9
9
  - `useUserSession()` for reactive auth state
10
10
  - `requireUserSession(event)` and related server helpers
@@ -14,7 +14,7 @@ Use this module if you want Better Auth in a Nuxt 4 app and you want the Nuxt-sp
14
14
 
15
15
  ## Install the module
16
16
 
17
- For the fastest path in a Nuxt 4 app:
17
+ For the fastest path in a Nuxt app:
18
18
 
19
19
  ```bash
20
20
  npx nuxi module add @nuxtjs/better-auth
package/dist/module.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@nuxtjs/better-auth",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "configKey": "auth",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.0.0"
7
7
  },
8
8
  "builder": {
9
- "@nuxt/module-builder": "1.0.2",
9
+ "@nuxt/module-builder": "1.0.3",
10
10
  "unbuild": "unknown"
11
11
  }
12
12
  }
package/dist/module.mjs CHANGED
@@ -10,7 +10,7 @@ import { randomBytes } from 'node:crypto';
10
10
  import { isCI, isTest } from 'std-env';
11
11
  export { defineClientAuth, defineServerAuth } from '../dist/runtime/config.js';
12
12
 
13
- const version = "0.1.3";
13
+ const version = "0.1.4";
14
14
 
15
15
  const CONFIG_EXTENSIONS = [".ts", ".js"];
16
16
  const CONFIG_EXTENSION_RE = /\.(?:ts|js)$/;
@@ -1,11 +1,11 @@
1
1
  import type { BetterAuthOptions, BetterAuthPlugin } from 'better-auth';
2
2
  import type { BetterAuthClientOptions } from 'better-auth/client';
3
- import type { Casing } from 'drizzle-orm/utils';
4
3
  import type { ServerAuthContext as BaseServerAuthContext } from './types/augment.js';
5
4
  import { createAuthClient } from 'better-auth/vue';
6
5
  export interface ServerAuthContextExtension {
7
6
  }
8
7
  export type ServerAuthContext = BaseServerAuthContext & ServerAuthContextExtension;
8
+ export type SchemaCasing = 'snake_case' | 'camelCase';
9
9
  export interface ClientAuthContext {
10
10
  siteUrl: string;
11
11
  }
@@ -71,7 +71,7 @@ export interface BetterAuthModuleOptions {
71
71
  /** Plural table names: user → users. Default: false */
72
72
  usePlural?: boolean;
73
73
  /** Column/table name casing. Explicit value takes precedence over hub.db.casing. */
74
- casing?: Casing;
74
+ casing?: SchemaCasing;
75
75
  /** PostgreSQL schema namespace. */
76
76
  schemaName?: string;
77
77
  };
@@ -1,4 +1,8 @@
1
1
  import { z } from 'zod';
2
- export declare const paginationQuerySchema: any;
2
+ export declare const paginationQuerySchema: z.ZodObject<{
3
+ page: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
4
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
5
+ search: z.ZodDefault<z.ZodString>;
6
+ }, z.core.$strip>;
3
7
  export type PaginationQuery = z.infer<typeof paginationQuerySchema>;
4
8
  export declare function sanitizeSearchPattern(search: string): string;
@@ -15,7 +15,7 @@ export default defineEventHandler(async (event) => {
15
15
  return { success: true };
16
16
  } catch (error) {
17
17
  if (error instanceof z.ZodError) {
18
- throw createAuthError(400, error.errors[0]?.message || "Invalid request");
18
+ throw createAuthError(400, error.issues[0]?.message || "Invalid request");
19
19
  }
20
20
  console.error("[DevTools] Delete session failed:", error);
21
21
  throw createAuthError(500, "Failed to delete session");
@@ -8,7 +8,7 @@ type UserAuthConfig = AuthOptions & {
8
8
  trustedOrigins?: BetterAuthOptions['trustedOrigins'];
9
9
  secondaryStorage?: BetterAuthOptions['secondaryStorage'];
10
10
  };
11
- type ResolvedAuthOptions = UserAuthConfig & {
11
+ type ResolvedAuthOptions = Omit<UserAuthConfig, 'secret' | 'baseURL' | 'trustedOrigins' | 'database'> & {
12
12
  secret: string;
13
13
  baseURL: string;
14
14
  trustedOrigins?: BetterAuthOptions['trustedOrigins'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxtjs/better-auth",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
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",
@@ -41,9 +41,12 @@
41
41
  "files": [
42
42
  "dist"
43
43
  ],
44
+ "engines": {
45
+ "node": "^22.19.0 || ^24.11.0 || >=26.0.0"
46
+ },
44
47
  "peerDependencies": {
45
48
  "@nuxthub/core": ">=0.10.5",
46
- "better-auth": ">=1.7.0-rc.5 <2"
49
+ "better-auth": ">=1.7.1 <2"
47
50
  },
48
51
  "peerDependenciesMeta": {
49
52
  "@nuxthub/core": {
@@ -51,50 +54,49 @@
51
54
  }
52
55
  },
53
56
  "dependencies": {
54
- "@nuxt/kit": "^4.3.1",
55
- "auth": "1.7.0-rc.5",
56
- "defu": "^6.1.4",
57
+ "@nuxt/devtools-kit": "^3.4.1",
58
+ "@nuxt/kit": "^4.5.2",
59
+ "auth": "1.7.1",
60
+ "consola": "^3.4.2",
61
+ "defu": "^6.1.7",
57
62
  "h3": "^1.15.11",
58
- "jiti": "^2.6.1",
63
+ "jiti": "^2.7.0",
59
64
  "pathe": "^2.0.3",
60
65
  "radix3": "^1.1.2",
61
- "std-env": "^4.0.0",
62
- "ufo": "^1.6.4"
66
+ "std-env": "^4.2.0",
67
+ "ufo": "^1.6.4",
68
+ "zod": "^4.4.3"
63
69
  },
64
70
  "devDependencies": {
65
- "@antfu/eslint-config": "^9.0.0",
66
- "@libsql/client": "^0.17.3",
71
+ "@antfu/eslint-config": "^9.3.0",
72
+ "@libsql/client": "^0.17.4",
67
73
  "@libsql/linux-x64-gnu": "0.5.29",
68
- "@nuxt/devtools": "^3.2.3",
69
- "@nuxt/devtools-kit": "^3.2.4",
70
- "@nuxt/module-builder": "^1.0.2",
71
- "@nuxt/schema": "^4.3.1",
72
- "@nuxt/test-utils": "^4.0.0",
73
- "@nuxthub/core": "^0.10.6",
74
- "@pinia/nuxt": "^0.11.3",
75
- "@types/better-sqlite3": "^7.6.13",
76
- "@types/node": "latest",
77
- "better-auth": "1.7.0-rc.5",
74
+ "@nuxt/devtools": "^3.4.1",
75
+ "@nuxt/module-builder": "^1.0.3",
76
+ "@nuxt/schema": "^4.5.2",
77
+ "@nuxt/test-utils": "^4.1.0",
78
+ "@nuxthub/core": "^0.10.8",
79
+ "@pinia/nuxt": "^1.0.2",
80
+ "@types/better-sqlite3": "^9.6.0",
81
+ "@types/node": "^24.13.3",
82
+ "better-auth": "1.7.1",
78
83
  "better-call": "1.4.0",
79
84
  "better-sqlite3": "^12.6.2",
80
- "consola": "^3.4.2",
81
85
  "drizzle-kit": "^0.31.10",
82
- "drizzle-orm": "^0.45.1",
83
- "eslint": "^10.0.3",
84
- "nitropack": "2.13.1",
85
- "nuxt": "^4.3.1",
86
- "pinia": "^3.0.4",
87
- "pkg-pr-new": "0.0.87",
86
+ "drizzle-orm": "^0.45.2",
87
+ "eslint": "^10.8.1",
88
+ "nitropack": "2.13.4",
89
+ "nuxt": "^4.5.2",
90
+ "pinia": "^4.0.3",
91
+ "pkg-pr-new": "0.0.88",
88
92
  "postgres": "^3.4.9",
89
- "tinyexec": "^1.1.1",
90
93
  "typescript": "~5.9.3",
91
94
  "unstorage": "^1.17.5",
92
- "vitest": "^4.0.18",
93
- "vitest-package-exports": "^1.2.0",
94
- "vue": "3.5.29",
95
- "vue-tsc": "^3.2.7",
96
- "wrangler": "4.72.0",
97
- "yaml": "^2.8.3"
95
+ "vitest": "^4.1.11",
96
+ "vue": "3.5.41",
97
+ "vue-tsc": "^3.3.10",
98
+ "wrangler": "4.124.0",
99
+ "yaml": "^2.9.0"
98
100
  },
99
101
  "scripts": {
100
102
  "build": "pnpm build:docs",