@nuxtjs/better-auth 0.2.4 → 0.2.5
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/dist/module.json
CHANGED
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.2.
|
|
13
|
+
const version = "0.2.5";
|
|
14
14
|
|
|
15
15
|
const CONFIG_EXTENSIONS = [".ts", ".js"];
|
|
16
16
|
const CONFIG_EXTENSION_RE$1 = /\.(?:ts|js)$/;
|
|
@@ -7,6 +7,7 @@ import { createVueSafeAuthFacade, isAuthProxyProbeKey } from "../internal/vue-sa
|
|
|
7
7
|
import { wrapAuthMethod } from "../internal/wrap-auth-method.js";
|
|
8
8
|
import { getAuthRuntimeFlags, useRawAuthClient } from "./useAuthClient.js";
|
|
9
9
|
let _signOutPromise = null;
|
|
10
|
+
const _sessionSyncApps = /* @__PURE__ */ new WeakSet();
|
|
10
11
|
function createServerOnlyActionNamespace(path) {
|
|
11
12
|
return new Proxy({}, {
|
|
12
13
|
get(_target, prop) {
|
|
@@ -96,7 +97,7 @@ export function useUserSession() {
|
|
|
96
97
|
hydrationReconcileQueued.value = false;
|
|
97
98
|
});
|
|
98
99
|
}
|
|
99
|
-
if (runtimeFlags.client && rawClient) {
|
|
100
|
+
if (runtimeFlags.client && rawClient && !_sessionSyncApps.has(nuxtApp)) {
|
|
100
101
|
const clientSession = rawClient.useSession();
|
|
101
102
|
const initialClientSession = clientSession.value;
|
|
102
103
|
const shouldReconcileInitialHydration = nuxtApp.isHydrating && nuxtApp.payload.serverRendered && Boolean(session.value && user.value) && !initialClientSession?.data?.session && !initialClientSession?.data?.user && !initialClientSession?.isPending && !initialClientSession?.isRefetching;
|
|
@@ -123,6 +124,7 @@ export function useUserSession() {
|
|
|
123
124
|
authReady.value = true;
|
|
124
125
|
}
|
|
125
126
|
);
|
|
127
|
+
_sessionSyncApps.add(nuxtApp);
|
|
126
128
|
}
|
|
127
129
|
function waitForSession() {
|
|
128
130
|
return new Promise((resolve) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxtjs/better-auth",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
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",
|