@lenne.tech/nuxt-extensions 1.18.2 → 1.18.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/CLAUDE.md +1 -1
- package/README.md +12 -7
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/transition/LtTransitionFade.d.vue.ts +2 -2
- package/dist/runtime/components/transition/LtTransitionFade.vue.d.ts +2 -2
- package/dist/runtime/components/transition/LtTransitionFadeScale.d.vue.ts +2 -2
- package/dist/runtime/components/transition/LtTransitionFadeScale.vue.d.ts +2 -2
- package/dist/runtime/lib/auth-client.d.ts +10 -3
- package/dist/runtime/plugins/auth-interceptor.client.d.ts +2 -2
- package/dist/runtime/plugins/auth-interceptor.client.js +3 -2
- package/package.json +17 -16
package/CLAUDE.md
CHANGED
|
@@ -347,7 +347,7 @@ fields at `app:beforeMount` and restores them at `app:mounted`, dispatching a sy
|
|
|
347
347
|
Handling" below).
|
|
348
348
|
3. **Check existing composables** before creating new ones — this module may already provide what you need
|
|
349
349
|
4. **Peer dependencies** (`better-auth`, `@better-auth/passkey`, `tus-js-client`) must be installed in the consuming project.
|
|
350
|
-
`better-auth` and `@better-auth/passkey` are pinned to **`>=1.7.
|
|
350
|
+
`better-auth` and `@better-auth/passkey` are pinned to **`>=1.7.7 <1.8.0`** — deliberately not a caret.
|
|
351
351
|
**They move in lock-step with `@lenne.tech/nest-server`.** better-auth is one protocol with two ends;
|
|
352
352
|
this module is the client end, nest-server the server end, and both declare the *same* narrow range.
|
|
353
353
|
Raising it means raising it in **both** framework repos and pinning the new version in **both** starters,
|
package/README.md
CHANGED
|
@@ -29,8 +29,8 @@ Reusable Nuxt 4 composables, components, and Better-Auth integration for lenne.t
|
|
|
29
29
|
|---|---|---|
|
|
30
30
|
| Node | `>= 22` | |
|
|
31
31
|
| Nuxt | `^4.0.0` | |
|
|
32
|
-
| `better-auth` | `>=1.7.
|
|
33
|
-
| `@better-auth/passkey` | `>=1.7.
|
|
32
|
+
| `better-auth` | `>=1.7.7 <1.8.0` | **required peer** — pin it, see below |
|
|
33
|
+
| `@better-auth/passkey` | `>=1.7.7 <1.8.0` | optional peer, passkey/WebAuthn only |
|
|
34
34
|
| `tus-js-client` | `>=4.0.0` | optional peer, resumable uploads only |
|
|
35
35
|
| `@lenne.tech/nest-server` | `>= 11.37.0` | **only if you use the backend** — see the lock-step rule |
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Reusable Nuxt 4 composables, components, and Better-Auth integration for lenne.t
|
|
|
38
38
|
better-auth is one protocol with two ends. This module is the client end and
|
|
39
39
|
`@lenne.tech/nest-server` is the server end, and they must resolve the **same**
|
|
40
40
|
better-auth minor. better-auth breaks in *minor* releases — 1.7 removed subpath
|
|
41
|
-
exports and changed the 2FA response shape — so a caret (`^1.7.
|
|
41
|
+
exports and changed the 2FA response shape — so a caret (`^1.7.7`) would re-open the
|
|
42
42
|
hole at 1.8. If the api and the app drift apart, 2FA activation fails at runtime with a
|
|
43
43
|
generic client error while **both** projects' checks stay green: each is internally
|
|
44
44
|
consistent, and only the assembled workspace has both halves.
|
|
@@ -46,12 +46,17 @@ consistent, and only the assembled workspace has both halves.
|
|
|
46
46
|
Raising better-auth therefore means raising it in `@lenne.tech/nest-server` **and**
|
|
47
47
|
`@lenne.tech/nuxt-extensions` in one step.
|
|
48
48
|
|
|
49
|
+
**Why the floor is 1.7.7:** better-auth below 1.7.7 is affected by
|
|
50
|
+
[GHSA-965c-763c-88jm](https://github.com/better-auth/better-auth/security/advisories/GHSA-965c-763c-88jm)
|
|
51
|
+
(critical): the OAuth state can be used as a magic link to sign in as another user. The flaw
|
|
52
|
+
is in the server end, so your API must run 1.7.7 too, and the pin below keeps both halves on it.
|
|
53
|
+
|
|
49
54
|
## Installation
|
|
50
55
|
|
|
51
56
|
```bash
|
|
52
|
-
npm install @lenne.tech/nuxt-extensions better-auth@1.7.
|
|
57
|
+
npm install @lenne.tech/nuxt-extensions better-auth@1.7.7
|
|
53
58
|
# Optional: For passkey support
|
|
54
|
-
npm install @better-auth/passkey@1.7.
|
|
59
|
+
npm install @better-auth/passkey@1.7.7
|
|
55
60
|
# Optional: For TUS file uploads
|
|
56
61
|
npm install tus-js-client
|
|
57
62
|
```
|
|
@@ -61,8 +66,8 @@ In a fullstack monorepo, pin it workspace-wide so the api and the app cannot dri
|
|
|
61
66
|
```yaml
|
|
62
67
|
# pnpm-workspace.yaml
|
|
63
68
|
overrides:
|
|
64
|
-
better-auth: 1.7.
|
|
65
|
-
'@better-auth/passkey': 1.7.
|
|
69
|
+
better-auth: 1.7.7
|
|
70
|
+
'@better-auth/passkey': 1.7.7
|
|
66
71
|
```
|
|
67
72
|
|
|
68
73
|
## Features
|
package/dist/module.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { LtExtensionsModuleOptions } from '../dist/runtime/types/index.js';
|
|
|
3
3
|
export * from '../dist/runtime/types/index.js';
|
|
4
4
|
|
|
5
5
|
declare const name = "@lenne.tech/nuxt-extensions";
|
|
6
|
-
declare const version = "1.18.
|
|
6
|
+
declare const version = "1.18.4";
|
|
7
7
|
declare const configKey = "ltExtensions";
|
|
8
8
|
declare const DEFAULT_LT_AUTH_STATE_COOKIE = "lt-auth-state";
|
|
9
9
|
declare const DEFAULT_LT_JWT_TOKEN_COOKIE = "lt-jwt-token";
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { defineNuxtModule, createResolver, tryResolveModule, addImports, addComp
|
|
|
2
2
|
import { pathToFileURL } from 'node:url';
|
|
3
3
|
|
|
4
4
|
const name = "@lenne.tech/nuxt-extensions";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.4";
|
|
6
6
|
const configKey = "ltExtensions";
|
|
7
7
|
const DEFAULT_LT_AUTH_STATE_COOKIE = "lt-auth-state";
|
|
8
8
|
const DEFAULT_LT_JWT_TOKEN_COOKIE = "lt-jwt-token";
|
|
@@ -26,8 +26,8 @@ type __VLS_Slots = {} & {
|
|
|
26
26
|
default?: (props: typeof __VLS_7) => any;
|
|
27
27
|
};
|
|
28
28
|
declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
29
|
-
leaveDuration:
|
|
30
|
-
startDuration:
|
|
29
|
+
leaveDuration: number | `${number}`;
|
|
30
|
+
startDuration: number | `${number}`;
|
|
31
31
|
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -26,8 +26,8 @@ type __VLS_Slots = {} & {
|
|
|
26
26
|
default?: (props: typeof __VLS_7) => any;
|
|
27
27
|
};
|
|
28
28
|
declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
29
|
-
leaveDuration:
|
|
30
|
-
startDuration:
|
|
29
|
+
leaveDuration: number | `${number}`;
|
|
30
|
+
startDuration: number | `${number}`;
|
|
31
31
|
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
|
|
32
32
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
33
|
declare const _default: typeof __VLS_export;
|
|
@@ -29,8 +29,8 @@ type __VLS_Slots = {} & {
|
|
|
29
29
|
default?: (props: typeof __VLS_7) => any;
|
|
30
30
|
};
|
|
31
31
|
declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
32
|
-
leaveDuration:
|
|
33
|
-
startDuration:
|
|
32
|
+
leaveDuration: number | `${number}`;
|
|
33
|
+
startDuration: number | `${number}`;
|
|
34
34
|
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
@@ -29,8 +29,8 @@ type __VLS_Slots = {} & {
|
|
|
29
29
|
default?: (props: typeof __VLS_7) => any;
|
|
30
30
|
};
|
|
31
31
|
declare const __VLS_base: import("@vue/runtime-core").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
32
|
-
leaveDuration:
|
|
33
|
-
startDuration:
|
|
32
|
+
leaveDuration: number | `${number}`;
|
|
33
|
+
startDuration: number | `${number}`;
|
|
34
34
|
}, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, false, {}, any>;
|
|
35
35
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
36
|
declare const _default: typeof __VLS_export;
|
|
@@ -169,7 +169,14 @@ export declare function createLtAuthClient(config?: LtAuthClientConfig): {
|
|
|
169
169
|
query?: import("better-auth").SessionQueryParams;
|
|
170
170
|
} | undefined) => Promise<void>;
|
|
171
171
|
}>>;
|
|
172
|
-
|
|
172
|
+
(useFetch: (url: string, options: {
|
|
173
|
+
headers?: HeadersInit;
|
|
174
|
+
key: string;
|
|
175
|
+
watch: import("vue").WatchSource<unknown>[];
|
|
176
|
+
}) => Promise<{
|
|
177
|
+
data: import("vue").Ref<unknown>;
|
|
178
|
+
error: import("vue").Ref<unknown>;
|
|
179
|
+
}>): Promise<{
|
|
173
180
|
data: import("vue").Ref<{
|
|
174
181
|
user: import("better-auth").StripEmptyObjects<{
|
|
175
182
|
id: string;
|
|
@@ -281,17 +288,17 @@ export declare function createLtAuthClient(config?: LtAuthClientConfig): {
|
|
|
281
288
|
onResponse: ((context: import("better-auth/client").ResponseContext) => Promise<Response | void | import("better-auth/client").ResponseContext> | Response | import("better-auth/client").ResponseContext | void) | undefined;
|
|
282
289
|
};
|
|
283
290
|
})[];
|
|
284
|
-
priority?: RequestPriority | undefined;
|
|
285
291
|
cache?: RequestCache | undefined;
|
|
286
292
|
credentials?: RequestCredentials;
|
|
287
293
|
integrity?: string | undefined;
|
|
288
294
|
keepalive?: boolean | undefined;
|
|
289
295
|
method: string;
|
|
290
296
|
mode?: RequestMode | undefined;
|
|
297
|
+
priority?: RequestPriority | undefined;
|
|
291
298
|
redirect?: RequestRedirect | undefined;
|
|
292
299
|
referrer?: string | undefined;
|
|
293
300
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
294
|
-
signal?:
|
|
301
|
+
signal?: AbortSignal | null;
|
|
295
302
|
window?: null | undefined;
|
|
296
303
|
onRetry?: ((response: import("better-auth/client").ResponseContext) => Promise<void> | void) | undefined;
|
|
297
304
|
hookOptions?: {
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
* Note: This is a client-only plugin (.client.ts) since auth state
|
|
17
17
|
* management only makes sense in the browser context.
|
|
18
18
|
*/
|
|
19
|
-
import type {
|
|
20
|
-
declare const _default:
|
|
19
|
+
import type { ObjectPlugin, Plugin } from '#app';
|
|
20
|
+
declare const _default: Plugin & ObjectPlugin;
|
|
21
21
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { defineNuxtPlugin } from "#imports";
|
|
1
2
|
import { useLtAuth } from "../composables/auth/use-lt-auth.js";
|
|
2
3
|
import { getLtApiBase } from "../lib/auth-state.js";
|
|
3
|
-
export default (nuxtApp) => {
|
|
4
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
4
5
|
if (import.meta.server) return;
|
|
5
6
|
let _authInstance = null;
|
|
6
7
|
function getAuth() {
|
|
@@ -154,4 +155,4 @@ export default (nuxtApp) => {
|
|
|
154
155
|
};
|
|
155
156
|
}
|
|
156
157
|
nuxtApp.provide("ltHandleUnauthorized", handleUnauthorized);
|
|
157
|
-
};
|
|
158
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nuxt-extensions",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.4",
|
|
4
4
|
"description": "Reusable Nuxt 4 composables, components, and Better-Auth integration for lenne.tech projects",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"prepack": "node scripts/sync-module-version.mjs && nuxt-module-build build",
|
|
52
52
|
"c": "pnpm run check",
|
|
53
53
|
"check": "node scripts/check.mjs",
|
|
54
|
-
"check:raw": "pnpm install --frozen-lockfile && pnpm audit && pnpm peers check && pnpm run format:check && pnpm run lint && pnpm run version:check && pnpm run dev:prepare && pnpm test:types && pnpm test && pnpm run build && pnpm run check:manifest",
|
|
55
|
-
"check:fix": "pnpm install && pnpm audit --fix && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run version:sync && pnpm test:types && pnpm test && pnpm run build && pnpm run check:manifest",
|
|
54
|
+
"check:raw": "pnpm install --frozen-lockfile && pnpm audit && pnpm run check:suppressions && pnpm peers check && pnpm run format:check && pnpm run lint && pnpm run version:check && pnpm run dev:prepare && pnpm test:types && pnpm test && pnpm run build && pnpm run check:manifest",
|
|
55
|
+
"check:fix": "pnpm install && pnpm audit --fix && pnpm run check:suppressions && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run version:sync && pnpm test:types && pnpm test && pnpm run build && pnpm run check:manifest",
|
|
56
56
|
"check:naf": "pnpm install && pnpm peers check && pnpm run format && pnpm run lint:fix && pnpm run version:sync && pnpm test:types && pnpm test && pnpm run build && pnpm run check:manifest",
|
|
57
57
|
"cf": "pnpm run check:fix",
|
|
58
58
|
"cnaf": "pnpm run check:naf",
|
|
@@ -72,15 +72,16 @@
|
|
|
72
72
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
73
73
|
"release": "pnpm format:check && pnpm lint && pnpm run version:check && pnpm test:types && pnpm test && pnpm run check:consumer && pnpm prepack",
|
|
74
74
|
"check:consumer": "node scripts/check-consumer-build.mjs",
|
|
75
|
-
"check:manifest": "node scripts/check-package-manifest.mjs"
|
|
75
|
+
"check:manifest": "node scripts/check-package-manifest.mjs",
|
|
76
|
+
"check:suppressions": "node scripts/check-suppressions.mjs"
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
79
|
"@nuxt/kit": "^4.0.0"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
|
-
"@better-auth/passkey": ">=1.7.
|
|
82
|
+
"@better-auth/passkey": ">=1.7.7 <1.8.0",
|
|
82
83
|
"@playwright/test": ">=1.0.0",
|
|
83
|
-
"better-auth": ">=1.7.
|
|
84
|
+
"better-auth": ">=1.7.7 <1.8.0",
|
|
84
85
|
"nuxt": "^4.0.0",
|
|
85
86
|
"tus-js-client": ">=4.0.0"
|
|
86
87
|
},
|
|
@@ -99,25 +100,25 @@
|
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
"devDependencies": {
|
|
102
|
-
"@better-auth/passkey": "1.7.
|
|
103
|
+
"@better-auth/passkey": "1.7.7",
|
|
103
104
|
"@nuxt/module-builder": "1.0.3",
|
|
104
105
|
"@nuxt/schema": "4.5.2",
|
|
105
|
-
"@nuxt/ui": "4.11.
|
|
106
|
+
"@nuxt/ui": "4.11.3",
|
|
106
107
|
"@playwright/test": "1.63.0",
|
|
107
|
-
"@types/node": "26.6.
|
|
108
|
-
"@vitest/coverage-v8": "
|
|
108
|
+
"@types/node": "26.6.4",
|
|
109
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
109
110
|
"@vue/server-renderer": "3.5.43",
|
|
110
|
-
"better-auth": "1.7.
|
|
111
|
+
"better-auth": "1.7.7",
|
|
111
112
|
"cross-spawn": "7.0.6",
|
|
112
113
|
"happy-dom": "20.14.5",
|
|
113
114
|
"nuxt": "4.5.2",
|
|
114
|
-
"oxfmt": "0.
|
|
115
|
-
"oxlint": "1.
|
|
116
|
-
"reka-ui": "2.10.
|
|
115
|
+
"oxfmt": "0.71.0",
|
|
116
|
+
"oxlint": "1.86.0",
|
|
117
|
+
"reka-ui": "2.10.5",
|
|
117
118
|
"tus-js-client": "4.3.1",
|
|
118
119
|
"typescript": "5.9.3",
|
|
119
|
-
"vitest": "
|
|
120
|
-
"vue-tsc": "3.3.
|
|
120
|
+
"vitest": "5.0.3",
|
|
121
|
+
"vue-tsc": "3.3.12"
|
|
121
122
|
},
|
|
122
123
|
"keywords": [
|
|
123
124
|
"nuxt",
|