@feelflow/ffid-sdk 5.24.0 → 5.24.1
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-7A2P3NII.js → chunk-C4RNFEME.js} +5 -3
- package/dist/{chunk-D7QD57HL.cjs → chunk-L5SBAHY3.cjs} +5 -3
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.js +1 -1
- package/dist/index.cjs +42 -42
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +5 -3
- package/dist/server/index.js +5 -3
- package/package.json +1 -1
|
@@ -89,7 +89,9 @@ function createMemoryStore() {
|
|
|
89
89
|
function isTokenData(value) {
|
|
90
90
|
if (typeof value !== "object" || value === null) return false;
|
|
91
91
|
const obj = value;
|
|
92
|
-
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" &&
|
|
92
|
+
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" && // Number.isFinite also rejects NaN/Infinity (e.g. a crafted `1e999` JSON
|
|
93
|
+
// literal parses to Infinity and would never trip the expiry check — #4271)
|
|
94
|
+
typeof obj.expiresAt === "number" && Number.isFinite(obj.expiresAt);
|
|
93
95
|
}
|
|
94
96
|
function createTokenStore(storageType) {
|
|
95
97
|
if (storageType === "memory") {
|
|
@@ -1225,7 +1227,7 @@ function createNonContractMethods(deps) {
|
|
|
1225
1227
|
}
|
|
1226
1228
|
|
|
1227
1229
|
// src/client/version-check.ts
|
|
1228
|
-
var SDK_VERSION = "5.24.
|
|
1230
|
+
var SDK_VERSION = "5.24.1";
|
|
1229
1231
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1230
1232
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1231
1233
|
function sdkHeaders() {
|
|
@@ -1280,7 +1282,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1280
1282
|
if (!tokenResponse.refresh_token) {
|
|
1281
1283
|
invalid.push("refresh_token");
|
|
1282
1284
|
}
|
|
1283
|
-
if (typeof tokenResponse.expires_in !== "number" || tokenResponse.expires_in <= 0) {
|
|
1285
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1284
1286
|
invalid.push("expires_in");
|
|
1285
1287
|
}
|
|
1286
1288
|
if (invalid.length > 0) {
|
|
@@ -91,7 +91,9 @@ function createMemoryStore() {
|
|
|
91
91
|
function isTokenData(value) {
|
|
92
92
|
if (typeof value !== "object" || value === null) return false;
|
|
93
93
|
const obj = value;
|
|
94
|
-
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" &&
|
|
94
|
+
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" && // Number.isFinite also rejects NaN/Infinity (e.g. a crafted `1e999` JSON
|
|
95
|
+
// literal parses to Infinity and would never trip the expiry check — #4271)
|
|
96
|
+
typeof obj.expiresAt === "number" && Number.isFinite(obj.expiresAt);
|
|
95
97
|
}
|
|
96
98
|
function createTokenStore(storageType) {
|
|
97
99
|
if (storageType === "memory") {
|
|
@@ -1227,7 +1229,7 @@ function createNonContractMethods(deps) {
|
|
|
1227
1229
|
}
|
|
1228
1230
|
|
|
1229
1231
|
// src/client/version-check.ts
|
|
1230
|
-
var SDK_VERSION = "5.24.
|
|
1232
|
+
var SDK_VERSION = "5.24.1";
|
|
1231
1233
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1232
1234
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1233
1235
|
function sdkHeaders() {
|
|
@@ -1282,7 +1284,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1282
1284
|
if (!tokenResponse.refresh_token) {
|
|
1283
1285
|
invalid.push("refresh_token");
|
|
1284
1286
|
}
|
|
1285
|
-
if (typeof tokenResponse.expires_in !== "number" || tokenResponse.expires_in <= 0) {
|
|
1287
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1286
1288
|
invalid.push("expires_in");
|
|
1287
1289
|
}
|
|
1288
1290
|
if (invalid.length > 0) {
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL5SBAHY3_cjs = require('../chunk-L5SBAHY3.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-
|
|
1
|
+
export { FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDSubscriptionBadge, FFIDUserMenu } from '../chunk-C4RNFEME.js';
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL5SBAHY3_cjs = require('./chunk-L5SBAHY3.cjs');
|
|
4
4
|
var chunkH5O2CCAY_cjs = require('./chunk-H5O2CCAY.cjs');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -54,8 +54,8 @@ function defaultRedirect(url) {
|
|
|
54
54
|
}
|
|
55
55
|
function useRequireActiveSubscription(options) {
|
|
56
56
|
const { redirectTo, allowGrace = true, onRedirect } = options;
|
|
57
|
-
const { isLoading, error } =
|
|
58
|
-
const { effectiveStatus, isBlocked, isGrace } =
|
|
57
|
+
const { isLoading, error } = chunkL5SBAHY3_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkL5SBAHY3_cjs.useSubscription();
|
|
59
59
|
const hasFetchError = error !== null && effectiveStatus === null;
|
|
60
60
|
const shouldRedirect = !isLoading && !hasFetchError && (isBlocked || !allowGrace && isGrace || effectiveStatus === null);
|
|
61
61
|
react.useEffect(() => {
|
|
@@ -76,7 +76,7 @@ function useRequireActiveSubscription(options) {
|
|
|
76
76
|
}
|
|
77
77
|
function withFFIDAuth(Component, options = {}) {
|
|
78
78
|
const WrappedComponent = (props) => {
|
|
79
|
-
const { isLoading, isAuthenticated, login } =
|
|
79
|
+
const { isLoading, isAuthenticated, login } = chunkL5SBAHY3_cjs.useFFIDContext();
|
|
80
80
|
const hasRedirected = react.useRef(false);
|
|
81
81
|
react.useEffect(() => {
|
|
82
82
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -105,155 +105,155 @@ var FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS = 1e3;
|
|
|
105
105
|
|
|
106
106
|
Object.defineProperty(exports, "ACCESS_GRANTING_EFFECTIVE_STATUSES", {
|
|
107
107
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkL5SBAHY3_cjs.ACCESS_GRANTING_EFFECTIVE_STATUSES; }
|
|
109
109
|
});
|
|
110
110
|
Object.defineProperty(exports, "BLOCKING_EFFECTIVE_STATUSES", {
|
|
111
111
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkL5SBAHY3_cjs.BLOCKING_EFFECTIVE_STATUSES; }
|
|
113
113
|
});
|
|
114
114
|
Object.defineProperty(exports, "DEFAULT_API_BASE_URL", {
|
|
115
115
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkL5SBAHY3_cjs.DEFAULT_API_BASE_URL; }
|
|
117
117
|
});
|
|
118
118
|
Object.defineProperty(exports, "DEFAULT_OAUTH_SCOPES", {
|
|
119
119
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkL5SBAHY3_cjs.DEFAULT_OAUTH_SCOPES; }
|
|
121
121
|
});
|
|
122
122
|
Object.defineProperty(exports, "EFFECTIVE_SUBSCRIPTION_STATUSES", {
|
|
123
123
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkL5SBAHY3_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDAnnouncementBadge; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDAnnouncementList; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDInquiryForm; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDLoginButton; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDOrganizationSwitcher; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDProvider; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDSDKError; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDSubscriptionBadge; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkL5SBAHY3_cjs.FFIDUserMenu; }
|
|
161
161
|
});
|
|
162
162
|
Object.defineProperty(exports, "FFID_ANNOUNCEMENTS_ERROR_CODES", {
|
|
163
163
|
enumerable: true,
|
|
164
|
-
get: function () { return
|
|
164
|
+
get: function () { return chunkL5SBAHY3_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
165
165
|
});
|
|
166
166
|
Object.defineProperty(exports, "FFID_ERROR_CODES", {
|
|
167
167
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkL5SBAHY3_cjs.FFID_ERROR_CODES; }
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkL5SBAHY3_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkL5SBAHY3_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
177
177
|
});
|
|
178
178
|
Object.defineProperty(exports, "clearState", {
|
|
179
179
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkL5SBAHY3_cjs.cleanupStateStorage; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkL5SBAHY3_cjs.computeEffectiveStatusFromSession; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkL5SBAHY3_cjs.createFFIDAnnouncementsClient; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkL5SBAHY3_cjs.createFFIDClient; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "createTokenStore", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkL5SBAHY3_cjs.createTokenStore; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkL5SBAHY3_cjs.generateCodeChallenge; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkL5SBAHY3_cjs.generateCodeVerifier; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "handleRedirectCallback", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkL5SBAHY3_cjs.handleRedirectCallback; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkL5SBAHY3_cjs.hasAccessFromUserinfo; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkL5SBAHY3_cjs.isBlockedFromUserinfo; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkL5SBAHY3_cjs.isFFIDInquiryCategorySite2026; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkL5SBAHY3_cjs.normalizeRedirectUri; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkL5SBAHY3_cjs.retrieveCodeVerifier; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "retrieveState", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkL5SBAHY3_cjs.retrieveState; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunkL5SBAHY3_cjs.storeCodeVerifier; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "storeState", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunkL5SBAHY3_cjs.storeState; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "useFFID", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunkL5SBAHY3_cjs.useFFID; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunkL5SBAHY3_cjs.useFFIDAnnouncements; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "useSubscription", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkL5SBAHY3_cjs.useSubscription; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "withSubscription", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunkL5SBAHY3_cjs.withSubscription; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
259
259
|
enumerable: true,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useFFIDContext, useSubscription } from './chunk-
|
|
2
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-
|
|
1
|
+
import { useFFIDContext, useSubscription } from './chunk-C4RNFEME.js';
|
|
2
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, BLOCKING_EFFECTIVE_STATUSES, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EFFECTIVE_SUBSCRIPTION_STATUSES, FFIDAnnouncementBadge, FFIDAnnouncementList, FFIDInquiryForm, FFIDLoginButton, FFIDOrganizationSwitcher, FFIDProvider, FFIDSDKError, FFIDSubscriptionBadge, FFIDUserMenu, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_INQUIRY_CATEGORIES, FFID_INQUIRY_CATEGORIES_SITE_2026, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, isFFIDInquiryCategorySite2026, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useFFIDAnnouncements, useSubscription, withSubscription } from './chunk-C4RNFEME.js';
|
|
3
3
|
export { ALL_DENIED_EXCEPT_NECESSARY, CONSENT_COOKIE_NAME, CONSENT_DISMISSAL_TIMESTAMP_KEY, COOKIE_VERSION, DEFAULT_CONSENT_ERROR_MESSAGES, FFIDAnalyticsProvider, FFIDConsentError, FFIDCookieBanner, FFIDCookieLink, FFIDCookieSettings, FFID_CONSENT_ERROR_CODES, clearConsentDismissalTimestamp, decodeConsentCookie, encodeConsentCookie, readConsentCookie, readConsentDismissalTimestamp, useFFIDConsent, useFFIDConsentPreferences, writeConsentCookie, writeConsentDismissalTimestamp } from './chunk-G7VOX64X.js';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
5
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
package/dist/server/index.cjs
CHANGED
|
@@ -86,7 +86,9 @@ function createMemoryStore() {
|
|
|
86
86
|
function isTokenData(value) {
|
|
87
87
|
if (typeof value !== "object" || value === null) return false;
|
|
88
88
|
const obj = value;
|
|
89
|
-
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" &&
|
|
89
|
+
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" && // Number.isFinite also rejects NaN/Infinity (e.g. a crafted `1e999` JSON
|
|
90
|
+
// literal parses to Infinity and would never trip the expiry check — #4271)
|
|
91
|
+
typeof obj.expiresAt === "number" && Number.isFinite(obj.expiresAt);
|
|
90
92
|
}
|
|
91
93
|
function createTokenStore(storageType) {
|
|
92
94
|
if (storageType === "memory") {
|
|
@@ -1222,7 +1224,7 @@ function createNonContractMethods(deps) {
|
|
|
1222
1224
|
}
|
|
1223
1225
|
|
|
1224
1226
|
// src/client/version-check.ts
|
|
1225
|
-
var SDK_VERSION = "5.24.
|
|
1227
|
+
var SDK_VERSION = "5.24.1";
|
|
1226
1228
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1227
1229
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1228
1230
|
function sdkHeaders() {
|
|
@@ -1277,7 +1279,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1277
1279
|
if (!tokenResponse.refresh_token) {
|
|
1278
1280
|
invalid.push("refresh_token");
|
|
1279
1281
|
}
|
|
1280
|
-
if (typeof tokenResponse.expires_in !== "number" || tokenResponse.expires_in <= 0) {
|
|
1282
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1281
1283
|
invalid.push("expires_in");
|
|
1282
1284
|
}
|
|
1283
1285
|
if (invalid.length > 0) {
|
package/dist/server/index.js
CHANGED
|
@@ -85,7 +85,9 @@ function createMemoryStore() {
|
|
|
85
85
|
function isTokenData(value) {
|
|
86
86
|
if (typeof value !== "object" || value === null) return false;
|
|
87
87
|
const obj = value;
|
|
88
|
-
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" &&
|
|
88
|
+
return typeof obj.accessToken === "string" && typeof obj.refreshToken === "string" && // Number.isFinite also rejects NaN/Infinity (e.g. a crafted `1e999` JSON
|
|
89
|
+
// literal parses to Infinity and would never trip the expiry check — #4271)
|
|
90
|
+
typeof obj.expiresAt === "number" && Number.isFinite(obj.expiresAt);
|
|
89
91
|
}
|
|
90
92
|
function createTokenStore(storageType) {
|
|
91
93
|
if (storageType === "memory") {
|
|
@@ -1221,7 +1223,7 @@ function createNonContractMethods(deps) {
|
|
|
1221
1223
|
}
|
|
1222
1224
|
|
|
1223
1225
|
// src/client/version-check.ts
|
|
1224
|
-
var SDK_VERSION = "5.24.
|
|
1226
|
+
var SDK_VERSION = "5.24.1";
|
|
1225
1227
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1226
1228
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1227
1229
|
function sdkHeaders() {
|
|
@@ -1276,7 +1278,7 @@ function validateTokenResponse(tokenResponse) {
|
|
|
1276
1278
|
if (!tokenResponse.refresh_token) {
|
|
1277
1279
|
invalid.push("refresh_token");
|
|
1278
1280
|
}
|
|
1279
|
-
if (typeof tokenResponse.expires_in !== "number" || tokenResponse.expires_in <= 0) {
|
|
1281
|
+
if (typeof tokenResponse.expires_in !== "number" || !Number.isFinite(tokenResponse.expires_in) || tokenResponse.expires_in <= 0) {
|
|
1280
1282
|
invalid.push("expires_in");
|
|
1281
1283
|
}
|
|
1282
1284
|
if (invalid.length > 0) {
|