@contentgrowth/content-auth 0.6.1 → 0.6.2
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/{chunk-AHFGJJZD.js → chunk-EDNWJGKD.js} +1 -1
- package/dist/{chunk-NKDKDBM2.js → chunk-W5RBQBED.js} +6 -2
- package/dist/frontend/client.d.ts +16 -2
- package/dist/frontend/client.js +1 -1
- package/dist/frontend/index.d.ts +1 -1
- package/dist/frontend/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
// src/frontend/client.ts
|
|
2
2
|
import { createAuthClient } from "better-auth/react";
|
|
3
3
|
import { organizationClient } from "better-auth/client/plugins";
|
|
4
|
-
var createClient = (baseUrl) => {
|
|
4
|
+
var createClient = (baseUrl, options = {}) => {
|
|
5
|
+
const { refetchOnWindowFocus = false } = options;
|
|
5
6
|
return createAuthClient({
|
|
6
7
|
baseURL: baseUrl,
|
|
7
8
|
plugins: [
|
|
8
9
|
organizationClient()
|
|
9
|
-
]
|
|
10
|
+
],
|
|
11
|
+
sessionOptions: {
|
|
12
|
+
refetchOnWindowFocus
|
|
13
|
+
}
|
|
10
14
|
});
|
|
11
15
|
};
|
|
12
16
|
var authClient = createClient();
|
|
@@ -3,7 +3,21 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
|
3
3
|
import * as better_auth from 'better-auth';
|
|
4
4
|
import * as better_auth_plugins from 'better-auth/plugins';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
interface ContentAuthClientOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Controls whether the session is re-fetched when the browser window
|
|
9
|
+
* regains focus (e.g. lock/unlock screen, switching apps in a PWA).
|
|
10
|
+
*
|
|
11
|
+
* Defaults to `false`. Re-fetching on focus causes a React re-render
|
|
12
|
+
* cascade that can interrupt active client-side sessions (e.g. vocabulary
|
|
13
|
+
* review flows) by triggering component remounts.
|
|
14
|
+
*
|
|
15
|
+
* Set to `true` only for apps that need the session to be always
|
|
16
|
+
* up-to-date immediately after the user returns to the tab.
|
|
17
|
+
*/
|
|
18
|
+
refetchOnWindowFocus?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const createClient: (baseUrl?: string, options?: ContentAuthClientOptions) => {
|
|
7
21
|
useActiveOrganization: () => {
|
|
8
22
|
data: better_auth.Prettify<{
|
|
9
23
|
id: string;
|
|
@@ -3194,4 +3208,4 @@ declare const authClient: {
|
|
|
3194
3208
|
};
|
|
3195
3209
|
};
|
|
3196
3210
|
|
|
3197
|
-
export { authClient, createClient };
|
|
3211
|
+
export { type ContentAuthClientOptions, authClient, createClient };
|
package/dist/frontend/client.js
CHANGED
package/dist/frontend/index.d.ts
CHANGED
package/dist/frontend/index.js
CHANGED
|
@@ -7,11 +7,11 @@ import {
|
|
|
7
7
|
PasswordChanger,
|
|
8
8
|
ProfileEditor,
|
|
9
9
|
ResetPasswordForm
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-EDNWJGKD.js";
|
|
11
11
|
import {
|
|
12
12
|
authClient,
|
|
13
13
|
createClient
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-W5RBQBED.js";
|
|
15
15
|
import "../chunk-R5U7XKVJ.js";
|
|
16
16
|
export {
|
|
17
17
|
AuthForm,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AuthConfig, EmailNormalizationConfig, FieldAttribute, SchemaMapping, SignInTrackingConfig, TableMapping, TurnstileConfig, authMiddleware, createAuth, createAuthApp, getInvitationLink, getSessionToken, isGmailAddress, normalizeEmail, schema, verifyTurnstile } from './backend/index.js';
|
|
2
2
|
export { AuthForm, CreateOrganizationForm, ForgotPasswordForm, InviteMemberForm, OrganizationSwitcher, PasswordChanger, PasswordChangerProps, ProfileEditor, ProfileEditorProps, ResetPasswordForm } from './frontend/index.js';
|
|
3
|
-
export { authClient, createClient } from './frontend/client.js';
|
|
3
|
+
export { ContentAuthClientOptions, authClient, createClient } from './frontend/client.js';
|
|
4
4
|
export * from 'better-auth';
|
|
5
5
|
export { Hono } from 'hono';
|
|
6
6
|
import 'hono/types';
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
PasswordChanger,
|
|
20
20
|
ProfileEditor,
|
|
21
21
|
ResetPasswordForm
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EDNWJGKD.js";
|
|
23
23
|
import {
|
|
24
24
|
authClient,
|
|
25
25
|
createClient
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-W5RBQBED.js";
|
|
27
27
|
import "./chunk-R5U7XKVJ.js";
|
|
28
28
|
export {
|
|
29
29
|
AuthForm,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentgrowth/content-auth",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Better Auth wrapper with UI components for Cloudflare Workers & Pages. Includes custom schema mapping, Turnstile bot protection, and email normalization.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|