@onmax/nuxt-better-auth 0.0.2-alpha.31 → 0.0.2-alpha.32
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 +60 -17
- package/dist/module.json +2 -2
- package/dist/module.mjs +580 -261
- package/dist/runtime/app/components/BetterAuthState.d.vue.ts +4 -4
- package/dist/runtime/app/components/BetterAuthState.vue +1 -1
- package/dist/runtime/app/components/BetterAuthState.vue.d.ts +4 -4
- package/dist/runtime/app/composables/useAuthClient.d.ts +9 -0
- package/dist/runtime/app/composables/useAuthClient.js +34 -0
- package/dist/runtime/app/composables/useAuthClientAction.d.ts +1 -3
- package/dist/runtime/app/composables/useAuthClientAction.js +2 -2
- package/dist/runtime/app/composables/useAuthRequestFetch.d.ts +1 -1
- package/dist/runtime/app/composables/useSignIn.js +2 -2
- package/dist/runtime/app/composables/useSignUp.js +2 -2
- package/dist/runtime/app/composables/useUserSession.d.ts +5 -4
- package/dist/runtime/app/composables/useUserSession.js +62 -69
- package/dist/runtime/app/composables/useUserSessionState.d.ts +3 -0
- package/dist/runtime/app/composables/useUserSessionState.js +4 -0
- package/dist/runtime/app/internal/session-fetch.d.ts +1 -1
- package/dist/runtime/app/internal/vue-safe-auth-proxy.d.ts +3 -0
- package/dist/runtime/app/internal/vue-safe-auth-proxy.js +68 -0
- package/dist/runtime/app/middleware/auth.global.js +5 -4
- package/dist/runtime/app/plugins/session.client.js +2 -1
- package/dist/runtime/composables.d.ts +11 -0
- package/dist/runtime/composables.js +9 -0
- package/dist/runtime/config.d.ts +4 -2
- package/dist/runtime/server/api/_better-auth/_schema.d.ts +1 -5
- package/dist/runtime/server/api/_better-auth/accounts.get.d.ts +2 -2
- package/dist/runtime/server/api/_better-auth/config.get.js +1 -1
- package/dist/runtime/server/api/_better-auth/sessions.get.d.ts +2 -2
- package/dist/runtime/server/api/_better-auth/users.get.d.ts +2 -2
- package/dist/runtime/server/middleware/route-access.js +1 -1
- package/dist/runtime/server/utils/auth.d.ts +13 -2
- package/dist/runtime/server/utils/auth.js +42 -16
- package/dist/runtime/server/utils/session.d.ts +3 -1
- package/dist/runtime/server/utils/session.js +175 -1
- package/dist/runtime/server/virtual-modules.d.ts +5 -0
- package/dist/runtime/types/augment.d.ts +1 -3
- package/dist/runtime/types.d.ts +1 -1
- package/package.json +28 -12
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { createDatabase, db } from "#auth/database";
|
|
2
|
-
import { createSecondaryStorage } from "#auth/secondary-storage";
|
|
3
|
-
import createServerAuth from "#auth/server";
|
|
4
1
|
import { betterAuth } from "better-auth";
|
|
5
2
|
import { getRequestHost, getRequestProtocol } from "h3";
|
|
6
3
|
import { useRuntimeConfig } from "nitropack/runtime";
|
|
7
4
|
import { withoutProtocol } from "ufo";
|
|
5
|
+
import { createDatabase, db } from "#auth/database";
|
|
6
|
+
import { createSecondaryStorage } from "#auth/secondary-storage";
|
|
7
|
+
import createServerAuth from "#auth/server";
|
|
8
8
|
import { resolveCustomSecondaryStorageRequirement } from "./custom-secondary-storage.js";
|
|
9
9
|
const _authCache = /* @__PURE__ */ new Map();
|
|
10
|
+
const requestAuthKey = Symbol.for("nuxt-better-auth.requestAuth");
|
|
10
11
|
let _baseURLInferenceLogged = false;
|
|
11
12
|
let _customSecondaryStorageMisconfigWarned = false;
|
|
13
|
+
const fallbackRequestAuthContext = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
function getRequestAuthContext(event) {
|
|
15
|
+
const eventWithContext = event;
|
|
16
|
+
if (eventWithContext.context && typeof eventWithContext.context === "object")
|
|
17
|
+
return eventWithContext.context;
|
|
18
|
+
let context = fallbackRequestAuthContext.get(event);
|
|
19
|
+
if (!context) {
|
|
20
|
+
context = {};
|
|
21
|
+
fallbackRequestAuthContext.set(event, context);
|
|
22
|
+
}
|
|
23
|
+
return context;
|
|
24
|
+
}
|
|
12
25
|
function normalizeLoopbackOrigin(origin) {
|
|
13
26
|
if (!import.meta.dev)
|
|
14
27
|
return origin;
|
|
@@ -155,8 +168,8 @@ function getRequestOrigin(request) {
|
|
|
155
168
|
return void 0;
|
|
156
169
|
}
|
|
157
170
|
}
|
|
158
|
-
function withDevTrustedOrigins(trustedOrigins
|
|
159
|
-
if (!import.meta.dev
|
|
171
|
+
function withDevTrustedOrigins(trustedOrigins) {
|
|
172
|
+
if (!import.meta.dev)
|
|
160
173
|
return trustedOrigins;
|
|
161
174
|
const devOrigins = getDevTrustedOrigins();
|
|
162
175
|
const mergeOrigins = (origins, request) => {
|
|
@@ -183,14 +196,15 @@ function withDevTrustedOrigins(trustedOrigins, hasExplicitSiteUrl) {
|
|
|
183
196
|
export function serverAuth(event) {
|
|
184
197
|
const runtimeConfig = useRuntimeConfig();
|
|
185
198
|
const siteUrl = getBaseURL(event);
|
|
199
|
+
const requestOrigin = resolveEventOrigin(event);
|
|
186
200
|
const hasExplicitSiteUrl = runtimeConfig.public.siteUrl && typeof runtimeConfig.public.siteUrl === "string";
|
|
187
201
|
const cacheKey = hasExplicitSiteUrl ? "__explicit__" : siteUrl;
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
191
|
-
const database = createDatabase();
|
|
192
|
-
const userConfig = createServerAuth({ runtimeConfig, db });
|
|
193
|
-
const trustedOrigins = withDevTrustedOrigins(userConfig.trustedOrigins
|
|
202
|
+
const requestContext = event ? getRequestAuthContext(event) : void 0;
|
|
203
|
+
if (requestContext?.[requestAuthKey])
|
|
204
|
+
return requestContext[requestAuthKey];
|
|
205
|
+
const database = createDatabase(event);
|
|
206
|
+
const userConfig = createServerAuth({ runtimeConfig, db, requestOrigin });
|
|
207
|
+
const trustedOrigins = withDevTrustedOrigins(userConfig.trustedOrigins);
|
|
194
208
|
const hubSecondaryStorage = runtimeConfig.auth?.hubSecondaryStorage;
|
|
195
209
|
const customSecondaryStorage = resolveCustomSecondaryStorageRequirement(hubSecondaryStorage, userConfig.secondaryStorage != null, Boolean(import.meta.dev));
|
|
196
210
|
if (customSecondaryStorage?.shouldThrow)
|
|
@@ -199,14 +213,26 @@ export function serverAuth(event) {
|
|
|
199
213
|
_customSecondaryStorageMisconfigWarned = true;
|
|
200
214
|
console.warn(customSecondaryStorage.message);
|
|
201
215
|
}
|
|
202
|
-
|
|
216
|
+
if (!database) {
|
|
217
|
+
const cached = _authCache.get(cacheKey);
|
|
218
|
+
if (cached) {
|
|
219
|
+
if (requestContext)
|
|
220
|
+
requestContext[requestAuthKey] = cached;
|
|
221
|
+
return cached;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const authOptions = {
|
|
203
225
|
...userConfig,
|
|
204
|
-
...database
|
|
205
|
-
...hubSecondaryStorage === true
|
|
226
|
+
...database ? { database } : {},
|
|
227
|
+
...hubSecondaryStorage === true ? { secondaryStorage: createSecondaryStorage() } : {},
|
|
206
228
|
secret: runtimeConfig.betterAuthSecret,
|
|
207
229
|
baseURL: siteUrl,
|
|
208
230
|
trustedOrigins
|
|
209
|
-
}
|
|
210
|
-
|
|
231
|
+
};
|
|
232
|
+
const auth = betterAuth(authOptions);
|
|
233
|
+
if (requestContext)
|
|
234
|
+
requestContext[requestAuthKey] = auth;
|
|
235
|
+
if (!database)
|
|
236
|
+
_authCache.set(cacheKey, auth);
|
|
211
237
|
return auth;
|
|
212
238
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { AppSession, RequireSessionOptions } from '#nuxt-better-auth';
|
|
2
1
|
import type { H3Event } from 'h3';
|
|
2
|
+
import type { AppSession, AuthSession, RequireSessionOptions } from '#nuxt-better-auth';
|
|
3
3
|
export declare function getRequestSession(event: H3Event): Promise<AppSession | null>;
|
|
4
4
|
export declare function getUserSession(event: H3Event): Promise<AppSession | null>;
|
|
5
|
+
export declare function setSessionCookie(event: H3Event, token: string): Promise<void>;
|
|
6
|
+
export declare function createSession(event: H3Event, userId: string): Promise<AuthSession>;
|
|
5
7
|
export declare function requireUserSession(event: H3Event, options?: RequireSessionOptions): Promise<AppSession>;
|
|
@@ -2,6 +2,8 @@ import { createError } from "h3";
|
|
|
2
2
|
import { matchesUser } from "../../utils/match-user.js";
|
|
3
3
|
import { serverAuth } from "./auth.js";
|
|
4
4
|
const requestSessionLoadKey = Symbol.for("nuxt-better-auth.requestSessionLoad");
|
|
5
|
+
const signingAlgorithm = { name: "HMAC", hash: "SHA-256" };
|
|
6
|
+
const cookiePairSeparatorRE = /;\s*/;
|
|
5
7
|
const fallbackRequestSessionContext = /* @__PURE__ */ new WeakMap();
|
|
6
8
|
function getRequestSessionContext(event) {
|
|
7
9
|
const eventWithContext = event;
|
|
@@ -14,9 +16,155 @@ function getRequestSessionContext(event) {
|
|
|
14
16
|
}
|
|
15
17
|
return context;
|
|
16
18
|
}
|
|
19
|
+
function getRequestHeaders(event) {
|
|
20
|
+
return getRequestSessionContext(event).requestHeaders ?? event.headers;
|
|
21
|
+
}
|
|
17
22
|
function loadSession(event) {
|
|
18
23
|
const auth = serverAuth(event);
|
|
19
|
-
return auth.api.getSession({ headers: event
|
|
24
|
+
return auth.api.getSession({ headers: getRequestHeaders(event) });
|
|
25
|
+
}
|
|
26
|
+
function getServerAuthContext(event) {
|
|
27
|
+
const auth = serverAuth(event);
|
|
28
|
+
return auth.$context;
|
|
29
|
+
}
|
|
30
|
+
function getCookieName(name, prefix) {
|
|
31
|
+
if (prefix === "secure")
|
|
32
|
+
return name.startsWith("__Secure-") ? name : `__Secure-${name}`;
|
|
33
|
+
if (prefix === "host")
|
|
34
|
+
return name.startsWith("__Host-") ? name : `__Host-${name}`;
|
|
35
|
+
if (prefix)
|
|
36
|
+
return void 0;
|
|
37
|
+
return name;
|
|
38
|
+
}
|
|
39
|
+
function serializeCookieHeader(name, value, attributes = {}, valueIsEncoded = false) {
|
|
40
|
+
const cookieName = getCookieName(name, attributes.prefix);
|
|
41
|
+
if (!cookieName)
|
|
42
|
+
throw new Error(`Unsupported cookie prefix: ${attributes.prefix}`);
|
|
43
|
+
const cookieValue = valueIsEncoded ? value : encodeURIComponent(value);
|
|
44
|
+
const cookie = [`${cookieName}=${cookieValue}`];
|
|
45
|
+
const options = { ...attributes };
|
|
46
|
+
if (cookieName.startsWith("__Secure-") && !options.secure)
|
|
47
|
+
options.secure = true;
|
|
48
|
+
if (cookieName.startsWith("__Host-")) {
|
|
49
|
+
options.secure = true;
|
|
50
|
+
options.path = "/";
|
|
51
|
+
delete options.domain;
|
|
52
|
+
}
|
|
53
|
+
if (typeof options.maxAge === "number" && options.maxAge >= 0)
|
|
54
|
+
cookie.push(`Max-Age=${Math.floor(options.maxAge)}`);
|
|
55
|
+
if (options.domain && options.prefix !== "host")
|
|
56
|
+
cookie.push(`Domain=${options.domain}`);
|
|
57
|
+
if (options.path)
|
|
58
|
+
cookie.push(`Path=${options.path}`);
|
|
59
|
+
if (options.expires)
|
|
60
|
+
cookie.push(`Expires=${options.expires.toUTCString()}`);
|
|
61
|
+
if (options.httpOnly)
|
|
62
|
+
cookie.push("HttpOnly");
|
|
63
|
+
if (options.partitioned)
|
|
64
|
+
options.secure = true;
|
|
65
|
+
if (options.secure)
|
|
66
|
+
cookie.push("Secure");
|
|
67
|
+
if (options.sameSite) {
|
|
68
|
+
const normalizedSameSite = options.sameSite.charAt(0).toUpperCase() + options.sameSite.slice(1);
|
|
69
|
+
cookie.push(`SameSite=${normalizedSameSite}`);
|
|
70
|
+
}
|
|
71
|
+
if (options.partitioned)
|
|
72
|
+
cookie.push("Partitioned");
|
|
73
|
+
return cookie.join("; ");
|
|
74
|
+
}
|
|
75
|
+
function serializeCookie(name, value, attributes = {}) {
|
|
76
|
+
return serializeCookieHeader(name, value, attributes);
|
|
77
|
+
}
|
|
78
|
+
async function signCookieValue(value, secret) {
|
|
79
|
+
const key = await crypto.subtle.importKey(
|
|
80
|
+
"raw",
|
|
81
|
+
new TextEncoder().encode(secret),
|
|
82
|
+
signingAlgorithm,
|
|
83
|
+
false,
|
|
84
|
+
["sign", "verify"]
|
|
85
|
+
);
|
|
86
|
+
const signature = await crypto.subtle.sign(
|
|
87
|
+
signingAlgorithm.name,
|
|
88
|
+
key,
|
|
89
|
+
new TextEncoder().encode(value)
|
|
90
|
+
);
|
|
91
|
+
return encodeURIComponent(`${value}.${btoa(String.fromCharCode(...new Uint8Array(signature)))}`);
|
|
92
|
+
}
|
|
93
|
+
async function serializeSignedCookie(name, value, secret, attributes = {}) {
|
|
94
|
+
return serializeCookieHeader(name, await signCookieValue(value, secret), attributes, true);
|
|
95
|
+
}
|
|
96
|
+
function appendCookieHeader(event, header) {
|
|
97
|
+
const nodeResponse = event.node?.res;
|
|
98
|
+
if (nodeResponse?.setHeader) {
|
|
99
|
+
const current = nodeResponse.getHeader?.("set-cookie");
|
|
100
|
+
if (Array.isArray(current))
|
|
101
|
+
nodeResponse.setHeader("set-cookie", [...current, header]);
|
|
102
|
+
else if (typeof current === "string")
|
|
103
|
+
nodeResponse.setHeader("set-cookie", [current, header]);
|
|
104
|
+
else
|
|
105
|
+
nodeResponse.setHeader("set-cookie", [header]);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const responseHeaders = event.response?.headers;
|
|
109
|
+
responseHeaders?.append("set-cookie", header);
|
|
110
|
+
}
|
|
111
|
+
function parseRequestCookies(cookieHeader) {
|
|
112
|
+
const cookies = /* @__PURE__ */ new Map();
|
|
113
|
+
if (!cookieHeader)
|
|
114
|
+
return cookies;
|
|
115
|
+
for (const pair of cookieHeader.split(cookiePairSeparatorRE)) {
|
|
116
|
+
if (!pair)
|
|
117
|
+
continue;
|
|
118
|
+
const separatorIndex = pair.indexOf("=");
|
|
119
|
+
if (separatorIndex < 0)
|
|
120
|
+
continue;
|
|
121
|
+
cookies.set(pair.slice(0, separatorIndex), pair.slice(separatorIndex + 1));
|
|
122
|
+
}
|
|
123
|
+
return cookies;
|
|
124
|
+
}
|
|
125
|
+
function serializeRequestCookies(cookies) {
|
|
126
|
+
if (!cookies.size)
|
|
127
|
+
return null;
|
|
128
|
+
return Array.from(cookies.entries()).map(([name, value]) => `${name}=${value}`).join("; ");
|
|
129
|
+
}
|
|
130
|
+
function extractResponseCookieValue(header) {
|
|
131
|
+
const separatorIndex = header.indexOf(";");
|
|
132
|
+
const cookiePair = separatorIndex >= 0 ? header.slice(0, separatorIndex) : header;
|
|
133
|
+
return cookiePair.slice(cookiePair.indexOf("=") + 1);
|
|
134
|
+
}
|
|
135
|
+
function getChunkedCookieNames(event, cookieName) {
|
|
136
|
+
const cookieNames = /* @__PURE__ */ new Set([cookieName]);
|
|
137
|
+
for (const name of parseRequestCookies(event.headers.get("cookie")).keys()) {
|
|
138
|
+
if (name.startsWith(`${cookieName}.`))
|
|
139
|
+
cookieNames.add(name);
|
|
140
|
+
}
|
|
141
|
+
return Array.from(cookieNames);
|
|
142
|
+
}
|
|
143
|
+
function expireCookie(event, cookieName, attributes) {
|
|
144
|
+
appendCookieHeader(event, serializeCookie(cookieName, "", {
|
|
145
|
+
...attributes,
|
|
146
|
+
expires: /* @__PURE__ */ new Date(0),
|
|
147
|
+
maxAge: 0
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
function expireCookies(event, cookie) {
|
|
151
|
+
for (const cookieName of getChunkedCookieNames(event, cookie.name))
|
|
152
|
+
expireCookie(event, cookieName, cookie.attributes);
|
|
153
|
+
}
|
|
154
|
+
function updateRequestHeaders(event, sessionCookie, clearedCookieNames) {
|
|
155
|
+
const requestContext = getRequestSessionContext(event);
|
|
156
|
+
const requestHeaders = new Headers(event.headers);
|
|
157
|
+
const cookies = parseRequestCookies(event.headers.get("cookie"));
|
|
158
|
+
for (const name of clearedCookieNames)
|
|
159
|
+
cookies.delete(name);
|
|
160
|
+
const sessionTokenName = sessionCookie.slice(0, sessionCookie.indexOf("="));
|
|
161
|
+
cookies.set(sessionTokenName, extractResponseCookieValue(sessionCookie));
|
|
162
|
+
const nextCookieHeader = serializeRequestCookies(cookies);
|
|
163
|
+
if (nextCookieHeader)
|
|
164
|
+
requestHeaders.set("cookie", nextCookieHeader);
|
|
165
|
+
else
|
|
166
|
+
requestHeaders.delete("cookie");
|
|
167
|
+
requestContext.requestHeaders = requestHeaders;
|
|
20
168
|
}
|
|
21
169
|
export async function getRequestSession(event) {
|
|
22
170
|
const context = getRequestSessionContext(event);
|
|
@@ -44,6 +192,32 @@ export async function getUserSession(event) {
|
|
|
44
192
|
return inFlight;
|
|
45
193
|
return loadSession(event);
|
|
46
194
|
}
|
|
195
|
+
export async function setSessionCookie(event, token) {
|
|
196
|
+
const context = await getServerAuthContext(event);
|
|
197
|
+
const sessionCookie = await serializeSignedCookie(
|
|
198
|
+
context.authCookies.sessionToken.name,
|
|
199
|
+
token,
|
|
200
|
+
context.secret,
|
|
201
|
+
{
|
|
202
|
+
...context.authCookies.sessionToken.attributes,
|
|
203
|
+
maxAge: context.sessionConfig.expiresIn
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
appendCookieHeader(event, sessionCookie);
|
|
207
|
+
expireCookies(event, context.authCookies.sessionData);
|
|
208
|
+
expireCookies(event, context.authCookies.dontRememberToken);
|
|
209
|
+
const requestContext = getRequestSessionContext(event);
|
|
210
|
+
delete requestContext.requestSession;
|
|
211
|
+
delete requestContext[requestSessionLoadKey];
|
|
212
|
+
updateRequestHeaders(event, sessionCookie, [
|
|
213
|
+
...getChunkedCookieNames(event, context.authCookies.sessionData.name),
|
|
214
|
+
...getChunkedCookieNames(event, context.authCookies.dontRememberToken.name)
|
|
215
|
+
]);
|
|
216
|
+
}
|
|
217
|
+
export async function createSession(event, userId) {
|
|
218
|
+
const context = await getServerAuthContext(event);
|
|
219
|
+
return context.internalAdapter.createSession?.(userId, false);
|
|
220
|
+
}
|
|
47
221
|
export async function requireUserSession(event, options) {
|
|
48
222
|
const session = await getRequestSession(event);
|
|
49
223
|
if (!session)
|
|
@@ -3,6 +3,11 @@ declare module '#auth/database' {
|
|
|
3
3
|
export function createDatabase(...args: any[]): any
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
declare module '#imports' {
|
|
7
|
+
export function getRouteRules(event: any): any
|
|
8
|
+
export function useRuntimeConfig(): any
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
declare module '#auth/secondary-storage' {
|
|
7
12
|
export function createSecondaryStorage(...args: any[]): any
|
|
8
13
|
}
|
|
@@ -21,17 +21,15 @@ export interface AuthSession {
|
|
|
21
21
|
export interface ServerAuthContext {
|
|
22
22
|
runtimeConfig: Record<string, unknown>;
|
|
23
23
|
db: unknown;
|
|
24
|
+
requestOrigin?: string;
|
|
24
25
|
}
|
|
25
26
|
export interface AuthSocialProviderRegistry {
|
|
26
27
|
}
|
|
27
28
|
export interface UserSessionComposable {
|
|
28
|
-
client: unknown;
|
|
29
29
|
user: Ref<AuthUser | null>;
|
|
30
30
|
session: Ref<AuthSession | null>;
|
|
31
31
|
loggedIn: ComputedRef<boolean>;
|
|
32
32
|
ready: ComputedRef<boolean>;
|
|
33
|
-
signIn: unknown;
|
|
34
|
-
signUp: unknown;
|
|
35
33
|
fetchSession: (options?: {
|
|
36
34
|
headers?: HeadersInit;
|
|
37
35
|
force?: boolean;
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AuthSocialProviderRegistry, AuthUser, UserMatch } from '#nuxt-better-auth';
|
|
2
1
|
import type { NitroRouteRules } from 'nitropack/types';
|
|
2
|
+
import type { AuthSocialProviderRegistry, AuthUser, UserMatch } from '#nuxt-better-auth';
|
|
3
3
|
export type { AppSession, AuthSession, AuthSocialProviderRegistry, AuthUser, RequireSessionOptions, ServerAuthContext, UserMatch, UserSessionComposable } from './types/augment.js';
|
|
4
4
|
export type AuthSocialProviderId = AuthSocialProviderRegistry extends {
|
|
5
5
|
ids: infer T;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onmax/nuxt-better-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.2-alpha.
|
|
5
|
-
"packageManager": "pnpm@
|
|
4
|
+
"version": "0.0.2-alpha.32",
|
|
5
|
+
"packageManager": "pnpm@11.1.0",
|
|
6
6
|
"description": "Nuxt module for Better Auth integration with NuxtHub, route protection, session management, and role-based access",
|
|
7
7
|
"author": "onmax",
|
|
8
8
|
"license": "MIT",
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/types.d.mts",
|
|
17
17
|
"import": "./dist/module.mjs"
|
|
18
18
|
},
|
|
19
|
+
"./composables": {
|
|
20
|
+
"types": "./dist/runtime/composables.d.ts",
|
|
21
|
+
"import": "./dist/runtime/composables.js"
|
|
22
|
+
},
|
|
19
23
|
"./config": {
|
|
20
24
|
"types": "./dist/runtime/config.d.ts",
|
|
21
25
|
"import": "./dist/runtime/config.js"
|
|
@@ -27,6 +31,9 @@
|
|
|
27
31
|
".": [
|
|
28
32
|
"./dist/types.d.mts"
|
|
29
33
|
],
|
|
34
|
+
"composables": [
|
|
35
|
+
"./dist/runtime/composables.d.ts"
|
|
36
|
+
],
|
|
30
37
|
"config": [
|
|
31
38
|
"./dist/runtime/config.d.ts"
|
|
32
39
|
]
|
|
@@ -46,7 +53,7 @@
|
|
|
46
53
|
"lint": "eslint .",
|
|
47
54
|
"lint:fix": "eslint . --fix",
|
|
48
55
|
"typecheck": "vue-tsc --noEmit",
|
|
49
|
-
"typecheck:runtime-server": "tsc --noEmit --pretty false -p
|
|
56
|
+
"typecheck:runtime-server": "cd test/cases/plugins-type-inference && nuxi prepare && vue-tsc --noEmit --pretty false -p .nuxt/tsconfig.server.json",
|
|
50
57
|
"typecheck:playground": "pnpm -C playground exec nuxi prepare && pnpm -C playground exec vue-tsc --noEmit -p .nuxt/tsconfig.app.json",
|
|
51
58
|
"test": "vitest run",
|
|
52
59
|
"test:watch": "vitest watch"
|
|
@@ -65,38 +72,47 @@
|
|
|
65
72
|
"@nuxt/kit": "^4.3.1",
|
|
66
73
|
"@nuxt/ui": "^4.5.0",
|
|
67
74
|
"defu": "^6.1.4",
|
|
75
|
+
"h3": "^1.15.11",
|
|
68
76
|
"jiti": "^2.6.1",
|
|
69
77
|
"pathe": "^2.0.3",
|
|
70
78
|
"radix3": "^1.1.2",
|
|
71
|
-
"std-env": "^4.0.0"
|
|
79
|
+
"std-env": "^4.0.0",
|
|
80
|
+
"ufo": "^1.6.4"
|
|
72
81
|
},
|
|
73
82
|
"devDependencies": {
|
|
74
|
-
"@antfu/eslint-config": "^
|
|
75
|
-
"@libsql/client": "^0.17.
|
|
76
|
-
"@libsql/linux-x64-gnu": "0.5.
|
|
83
|
+
"@antfu/eslint-config": "^9.0.0",
|
|
84
|
+
"@libsql/client": "^0.17.3",
|
|
85
|
+
"@libsql/linux-x64-gnu": "0.5.29",
|
|
77
86
|
"@nuxt/devtools": "^3.2.3",
|
|
78
|
-
"@nuxt/devtools-kit": "^3.2.
|
|
87
|
+
"@nuxt/devtools-kit": "^3.2.4",
|
|
79
88
|
"@nuxt/module-builder": "^1.0.2",
|
|
80
89
|
"@nuxt/schema": "^4.3.1",
|
|
81
90
|
"@nuxt/test-utils": "^4.0.0",
|
|
82
91
|
"@nuxthub/core": "^0.10.6",
|
|
92
|
+
"@pinia/nuxt": "^0.11.3",
|
|
83
93
|
"@types/better-sqlite3": "^7.6.13",
|
|
84
94
|
"@types/node": "latest",
|
|
85
95
|
"better-auth": "1.5.5",
|
|
96
|
+
"better-call": "1.3.2",
|
|
86
97
|
"better-sqlite3": "^12.6.2",
|
|
87
98
|
"bumpp": "^11.0.0",
|
|
88
99
|
"changelogen": "^0.6.2",
|
|
89
100
|
"consola": "^3.4.2",
|
|
90
|
-
"drizzle-kit": "^0.31.
|
|
101
|
+
"drizzle-kit": "^0.31.10",
|
|
91
102
|
"drizzle-orm": "^0.45.1",
|
|
92
103
|
"eslint": "^10.0.3",
|
|
104
|
+
"nitropack": "2.13.1",
|
|
93
105
|
"npm-agentskills": "https://pkg.pr.new/onmax/npm-agentskills@394499e",
|
|
94
106
|
"nuxt": "^4.3.1",
|
|
95
|
-
"
|
|
107
|
+
"pinia": "^3.0.4",
|
|
108
|
+
"postgres": "^3.4.9",
|
|
109
|
+
"tinyexec": "^1.1.1",
|
|
96
110
|
"typescript": "~5.9.3",
|
|
111
|
+
"unstorage": "^1.17.5",
|
|
97
112
|
"vitest": "^4.0.18",
|
|
98
113
|
"vitest-package-exports": "^1.2.0",
|
|
99
|
-
"vue
|
|
100
|
-
"
|
|
114
|
+
"vue": "3.5.29",
|
|
115
|
+
"vue-tsc": "^3.2.7",
|
|
116
|
+
"yaml": "^2.8.3"
|
|
101
117
|
}
|
|
102
118
|
}
|