Skip to content

Commit 1bf93d5

Browse files
refactor: server export default (#9)
* refactor: server export default - Updated various dependencies in pnpm-workspace.yaml to their latest versions, including @nuxt packages, better-auth, and tailwindcss. - Refactored better-auth configuration in module.ts to call config functions correctly. - Changed server export in server.ts to use an arrow function for better compatibility. - Enhanced useAuth function in useAuth.ts to initialize _auth only once and ensure proper function calls for configs. * fix: correct formatting in default export function
1 parent aadcd41 commit 1bf93d5

File tree

8 files changed

+2567
-773
lines changed

8 files changed

+2567
-773
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ Create a `*.better-auth.ts` file to configure server-side auth:
212212
// server/my-auth.better-auth.ts
213213
import type { BetterAuthOptions } from 'better-auth'
214214

215-
export default {
215+
export default () => ({
216216
// Custom server-side auth configuration
217-
} satisfies BetterAuthOptions
217+
} satisfies BetterAuthOptions)
218218
```
219219

220220
### Client Configuration

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@
6464
"vitest": "catalog:",
6565
"vue-tsc": "catalog:"
6666
},
67-
"packageManager": "pnpm@10.10.0"
67+
"packageManager": "pnpm@10.11.0"
6868
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { BetterAuthOptions } from 'better-auth'
22
import { admin, openAPI, username } from 'better-auth/plugins'
33

4-
export default {
4+
export default () => ({
55
emailAndPassword: {
66
enabled: true,
77
},
@@ -11,4 +11,4 @@ export default {
1111
username(),
1212
],
1313
trustedOrigins: [],
14-
} satisfies BetterAuthOptions
14+
} satisfies BetterAuthOptions)

0 commit comments

Comments
 (0)