@feelflow/ffid-sdk 5.19.0 → 5.22.0
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 +1 -0
- package/dist/agency/index.cjs +4 -2
- package/dist/agency/index.js +4 -2
- package/dist/announcements/index.cjs +2 -1
- package/dist/announcements/index.js +2 -1
- package/dist/{chunk-D3PZ6SZB.js → chunk-7NRO2TBG.js} +108 -53
- package/dist/{chunk-TW2FXASO.cjs → chunk-EM5EGNGE.cjs} +108 -53
- package/dist/components/index.cjs +8 -8
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{ffid-client-BuDM5tmq.d.cts → ffid-client-CEJMpqRZ.d.cts} +55 -9
- package/dist/{ffid-client-D0x8TBS5.d.ts → ffid-client-DM0ZhIDV.d.ts} +55 -9
- package/dist/{index-Bkul-fRw.d.cts → index-btouGGKr.d.cts} +56 -9
- package/dist/{index-Bkul-fRw.d.ts → index-btouGGKr.d.ts} +56 -9
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +44 -8
- package/dist/index.d.ts +44 -8
- package/dist/index.js +2 -2
- package/dist/legal/index.cjs +2 -1
- package/dist/legal/index.js +2 -1
- package/dist/server/index.cjs +94 -48
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +94 -48
- package/dist/server/test/index.d.cts +2 -2
- package/dist/server/test/index.d.ts +2 -2
- package/dist/{types-BeVl-z12.d.cts → types-Cjb9J0rL.d.cts} +2 -1
- package/dist/{types-BeVl-z12.d.ts → types-Cjb9J0rL.d.ts} +2 -1
- package/dist/webhooks/index.cjs +2 -2
- package/dist/webhooks/index.d.cts +1 -1
- package/dist/webhooks/index.d.ts +1 -1
- package/dist/webhooks/index.js +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEM5EGNGE_cjs = require('./chunk-EM5EGNGE.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 } = chunkEM5EGNGE_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkEM5EGNGE_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 } = chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDAnnouncementBadge; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDAnnouncementList; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDInquiryForm; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDLoginButton; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDOrganizationSwitcher; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDProvider; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDSDKError; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkEM5EGNGE_cjs.FFIDSubscriptionBadge; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_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 chunkEM5EGNGE_cjs.cleanupStateStorage; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkEM5EGNGE_cjs.computeEffectiveStatusFromSession; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkEM5EGNGE_cjs.createFFIDAnnouncementsClient; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkEM5EGNGE_cjs.createFFIDClient; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "createTokenStore", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkEM5EGNGE_cjs.createTokenStore; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkEM5EGNGE_cjs.generateCodeChallenge; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkEM5EGNGE_cjs.generateCodeVerifier; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "handleRedirectCallback", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkEM5EGNGE_cjs.handleRedirectCallback; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkEM5EGNGE_cjs.hasAccessFromUserinfo; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkEM5EGNGE_cjs.isBlockedFromUserinfo; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkEM5EGNGE_cjs.isFFIDInquiryCategorySite2026; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkEM5EGNGE_cjs.normalizeRedirectUri; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkEM5EGNGE_cjs.retrieveCodeVerifier; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "retrieveState", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkEM5EGNGE_cjs.retrieveState; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunkEM5EGNGE_cjs.storeCodeVerifier; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "storeState", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunkEM5EGNGE_cjs.storeState; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "useFFID", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunkEM5EGNGE_cjs.useFFID; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunkEM5EGNGE_cjs.useFFIDAnnouncements; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "useSubscription", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkEM5EGNGE_cjs.useSubscription; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "withSubscription", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunkEM5EGNGE_cjs.withSubscription; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
259
259
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDSignOutResult, f as FFIDRedirectResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDOAuthUserInfoSubscription, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-btouGGKr.cjs';
|
|
2
|
+
export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryCategory, R as FFIDInquiryCategorySite2026, S as FFIDInquiryForm, T as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDOAuthTokenResponse, a3 as FFIDOAuthUserInfoMemberRole, a4 as FFIDOrganizationSwitcher, a5 as FFIDRedirectErrorCode, a6 as FFIDSeatModel, a7 as FFIDServiceAccessDenialReason, a8 as FFIDServiceAccessFailPolicy, a9 as FFIDSubscriptionBadge, aa as FFIDTokenIntrospectionResponse, ab as FFIDUserMenu, ac as FFID_INQUIRY_CATEGORIES, ad as FFID_INQUIRY_CATEGORIES_SITE_2026, ae as UseFFIDAnnouncementsOptions, af as UseFFIDAnnouncementsReturn, ag as isFFIDInquiryCategorySite2026, ah as useFFIDAnnouncements } from './index-btouGGKr.cjs';
|
|
3
3
|
export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-BJgVcJyw.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
@@ -1368,7 +1368,7 @@ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
|
|
|
1368
1368
|
/** Creates an FFID API client instance */
|
|
1369
1369
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
1370
1370
|
getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
|
|
1371
|
-
signOut: () => Promise<FFIDApiResponse<
|
|
1371
|
+
signOut: () => Promise<FFIDApiResponse<FFIDSignOutResult>>;
|
|
1372
1372
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1373
1373
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1374
1374
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
@@ -1524,7 +1524,25 @@ interface HandleRedirectCallbackOptions {
|
|
|
1524
1524
|
* absolute URL, a relative URL, or a bare query string. Defaults to
|
|
1525
1525
|
* `window.location.search` in the browser.
|
|
1526
1526
|
*/
|
|
1527
|
-
url?: string;
|
|
1527
|
+
url?: string | undefined;
|
|
1528
|
+
/**
|
|
1529
|
+
* Whether to remove `code` / `state` from the browser URL via
|
|
1530
|
+
* `window.history.replaceState` after a successful exchange. Defaults to
|
|
1531
|
+
* `true`.
|
|
1532
|
+
*
|
|
1533
|
+
* Set to `false` to take over URL cleanup on the consumer side. This matters
|
|
1534
|
+
* on Next.js App Router: the App Router patches `history.replaceState`, so
|
|
1535
|
+
* the SDK's cleanup re-evaluates `useSearchParams()` and re-runs any effect
|
|
1536
|
+
* that depends on it. A callback effect that treats "no `code` in the URL"
|
|
1537
|
+
* as "start a new login" then fires `login()` again, causing repeated
|
|
1538
|
+
* authorize redirects (#4254). With `cleanUrl: false`, remove `code` /
|
|
1539
|
+
* `state` yourself once callback handling is done — keep the other query
|
|
1540
|
+
* params, mirroring the SDK's own cleanup. Consumed callback params left in
|
|
1541
|
+
* the URL fail on reload with `STATE_MISMATCH_ERROR`: the one-time OAuth
|
|
1542
|
+
* `state` stored at authorize time was already consumed, so re-processing
|
|
1543
|
+
* fails state validation before any exchange is attempted.
|
|
1544
|
+
*/
|
|
1545
|
+
cleanUrl?: boolean | undefined;
|
|
1528
1546
|
}
|
|
1529
1547
|
/**
|
|
1530
1548
|
* Complete an OAuth authorization-code redirect.
|
|
@@ -1538,13 +1556,14 @@ interface HandleRedirectCallbackOptions {
|
|
|
1538
1556
|
* neither side has any state (a genuine no-state flow). Omitting the callback
|
|
1539
1557
|
* `state` does NOT bypass the check (#3841).
|
|
1540
1558
|
* 3. Retrieves the PKCE verifier and exchanges the code for tokens.
|
|
1541
|
-
* 4. On success, removes `code` + `state` from the browser URL
|
|
1559
|
+
* 4. On success, removes `code` + `state` from the browser URL (skipped when
|
|
1560
|
+
* `options.cleanUrl` is `false` — the consumer then owns URL cleanup).
|
|
1542
1561
|
*
|
|
1543
1562
|
* SSR-safe: when there is no `window` and no `options.url`, no exchange is
|
|
1544
1563
|
* attempted and an error result is returned.
|
|
1545
1564
|
*
|
|
1546
1565
|
* @param client - FFID client (or any object exposing exchangeCodeForTokens / createError / logger)
|
|
1547
|
-
* @param options - Optional callback URL override
|
|
1566
|
+
* @param options - Optional callback URL override and URL cleanup control (see {@link HandleRedirectCallbackOptions})
|
|
1548
1567
|
*/
|
|
1549
1568
|
declare function handleRedirectCallback(client: HandleRedirectCallbackClient, options?: HandleRedirectCallbackOptions): Promise<FFIDApiResponse<void>>;
|
|
1550
1569
|
|
|
@@ -1596,6 +1615,23 @@ declare function createKVCacheAdapter(kv: KVNamespaceLike): FFIDCacheAdapter;
|
|
|
1596
1615
|
interface FFIDProviderProps extends FFIDConfig {
|
|
1597
1616
|
/** Child components */
|
|
1598
1617
|
children: ReactNode;
|
|
1618
|
+
/**
|
|
1619
|
+
* Token mode only: whether the provider removes `code` / `state` from the
|
|
1620
|
+
* browser URL (`history.replaceState`) after a successful code exchange.
|
|
1621
|
+
* Defaults to `true`. Forwarded to
|
|
1622
|
+
* {@link HandleRedirectCallbackOptions.cleanUrl} — see its JSDoc for the
|
|
1623
|
+
* Next.js App Router background (#4254). Read once when the mount-time code
|
|
1624
|
+
* exchange runs; toggling it afterwards has no effect.
|
|
1625
|
+
*
|
|
1626
|
+
* Set to `false` on Next.js App Router when the patched history API
|
|
1627
|
+
* re-evaluating `useSearchParams()` (and re-running effects that depend on
|
|
1628
|
+
* it) is a problem — then remove `code` / `state` yourself (keeping other
|
|
1629
|
+
* query params) after authentication completes. Consumed callback params
|
|
1630
|
+
* left in the URL fail on reload with `STATE_MISMATCH_ERROR` (the one-time
|
|
1631
|
+
* OAuth `state` was already consumed), which also leaves an authenticated
|
|
1632
|
+
* user rendered as signed-out until the URL is cleaned.
|
|
1633
|
+
*/
|
|
1634
|
+
cleanCallbackUrl?: boolean | undefined;
|
|
1599
1635
|
}
|
|
1600
1636
|
/**
|
|
1601
1637
|
* FFIDProvider - Wrap your app to enable FFID authentication
|
|
@@ -1607,7 +1643,7 @@ interface FFIDProviderProps extends FFIDConfig {
|
|
|
1607
1643
|
* - Automatic session refresh
|
|
1608
1644
|
* - Token mode: automatic code exchange and token refresh
|
|
1609
1645
|
*/
|
|
1610
|
-
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
1646
|
+
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, cleanCallbackUrl, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
1611
1647
|
|
|
1612
1648
|
/**
|
|
1613
1649
|
* Return type for useFFID hook
|
|
@@ -2280,4 +2316,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
2280
2316
|
};
|
|
2281
2317
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
2282
2318
|
|
|
2283
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
|
2319
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDSignOutResult, f as FFIDRedirectResult, g as FFIDError, h as FFIDSubscriptionCheckResponse, i as FFIDCheckServiceAccessParams, j as FFIDServiceAccessDecision, k as FFIDAnalyticsConfig, l as FFIDVerifyAccessTokenOptions, m as FFIDOAuthUserInfo, n as FFIDInquiryCreateParams, o as FFIDInquiryCreateResponse, p as FFIDAuthMode, q as FFIDLogger, r as FFIDCacheAdapter, s as FFIDUser, t as FFIDOrganization, u as FFIDSubscription, v as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, w as FFIDOAuthUserInfoSubscription, x as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, y as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, z as FFIDAnnouncementsLogger } from './index-btouGGKr.js';
|
|
2
|
+
export { B as Announcement, C as AnnouncementStatus, D as AnnouncementType, G as EFFECTIVE_SUBSCRIPTION_STATUSES, H as FFIDAnnouncementBadge, I as FFIDAnnouncementList, J as FFIDAnnouncementsError, K as FFIDAnnouncementsErrorCode, M as FFIDAnnouncementsServerResponse, N as FFIDApiResponseMeta, O as FFIDCacheConfig, P as FFIDContextValue, Q as FFIDInquiryCategory, R as FFIDInquiryCategorySite2026, S as FFIDInquiryForm, T as FFIDInquiryFormCategoryItem, U as FFIDInquiryFormClassNames, V as FFIDInquiryFormLegalLayout, W as FFIDInquiryFormOrganization, X as FFIDInquiryFormPlaceholderContext, Y as FFIDInquiryFormPrefill, Z as FFIDInquiryFormProps, _ as FFIDInquiryFormSubmitData, $ as FFIDInquiryFormSubmitResult, a0 as FFIDJwtClaims, a1 as FFIDLoginButton, a2 as FFIDOAuthTokenResponse, a3 as FFIDOAuthUserInfoMemberRole, a4 as FFIDOrganizationSwitcher, a5 as FFIDRedirectErrorCode, a6 as FFIDSeatModel, a7 as FFIDServiceAccessDenialReason, a8 as FFIDServiceAccessFailPolicy, a9 as FFIDSubscriptionBadge, aa as FFIDTokenIntrospectionResponse, ab as FFIDUserMenu, ac as FFID_INQUIRY_CATEGORIES, ad as FFID_INQUIRY_CATEGORIES_SITE_2026, ae as UseFFIDAnnouncementsOptions, af as UseFFIDAnnouncementsReturn, ag as isFFIDInquiryCategorySite2026, ah as useFFIDAnnouncements } from './index-btouGGKr.js';
|
|
3
3
|
export { A as ALL_DENIED_EXCEPT_NECESSARY, i as CONSENT_COOKIE_NAME, j as CONSENT_DISMISSAL_TIMESTAMP_KEY, l as COOKIE_VERSION, D as DEFAULT_CONSENT_ERROR_MESSAGES, o as FFIDAnalyticsProvider, p as FFIDAnalyticsProviderProps, c as FFIDConsentCategories, r as FFIDConsentCategoryCode, e as FFIDConsentCategoryMetadata, w as FFIDConsentError, x as FFIDConsentErrorCode, y as FFIDConsentMergeStrategy, B as FFIDConsentMergeWarning, E as FFIDConsentMergeWarningEvent, F as FFIDConsentResult, I as FFIDConsentSource, a as FFIDConsentState, d as FFIDConsentSyncResult, M as FFIDCookieBanner, N as FFIDCookieBannerClassNames, O as FFIDCookieBannerProps, Q as FFIDCookieLink, R as FFIDCookieLinkProps, f as FFIDCookiePolicy, T as FFIDCookieSettings, U as FFIDCookieSettingsClassNames, V as FFIDCookieSettingsProps, _ as FFID_CONSENT_ERROR_CODES, ae as UseFFIDConsentPreferencesReturn, af as UseFFIDConsentReturn, ag as clearConsentDismissalTimestamp, aj as decodeConsentCookie, al as encodeConsentCookie, an as readConsentCookie, ao as readConsentDismissalTimestamp, aq as useFFIDConsent, ar as useFFIDConsentPreferences, as as writeConsentCookie, at as writeConsentDismissalTimestamp } from './FFIDCookieLink-BJgVcJyw.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { ReactNode, ComponentType, FC } from 'react';
|
|
@@ -1368,7 +1368,7 @@ type FFIDErrorCode = (typeof FFID_ERROR_CODES)[keyof typeof FFID_ERROR_CODES];
|
|
|
1368
1368
|
/** Creates an FFID API client instance */
|
|
1369
1369
|
declare function createFFIDClient(config: FFIDConfig): {
|
|
1370
1370
|
getSession: () => Promise<FFIDApiResponse<FFIDSessionResponse>>;
|
|
1371
|
-
signOut: () => Promise<FFIDApiResponse<
|
|
1371
|
+
signOut: () => Promise<FFIDApiResponse<FFIDSignOutResult>>;
|
|
1372
1372
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1373
1373
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1374
1374
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
@@ -1524,7 +1524,25 @@ interface HandleRedirectCallbackOptions {
|
|
|
1524
1524
|
* absolute URL, a relative URL, or a bare query string. Defaults to
|
|
1525
1525
|
* `window.location.search` in the browser.
|
|
1526
1526
|
*/
|
|
1527
|
-
url?: string;
|
|
1527
|
+
url?: string | undefined;
|
|
1528
|
+
/**
|
|
1529
|
+
* Whether to remove `code` / `state` from the browser URL via
|
|
1530
|
+
* `window.history.replaceState` after a successful exchange. Defaults to
|
|
1531
|
+
* `true`.
|
|
1532
|
+
*
|
|
1533
|
+
* Set to `false` to take over URL cleanup on the consumer side. This matters
|
|
1534
|
+
* on Next.js App Router: the App Router patches `history.replaceState`, so
|
|
1535
|
+
* the SDK's cleanup re-evaluates `useSearchParams()` and re-runs any effect
|
|
1536
|
+
* that depends on it. A callback effect that treats "no `code` in the URL"
|
|
1537
|
+
* as "start a new login" then fires `login()` again, causing repeated
|
|
1538
|
+
* authorize redirects (#4254). With `cleanUrl: false`, remove `code` /
|
|
1539
|
+
* `state` yourself once callback handling is done — keep the other query
|
|
1540
|
+
* params, mirroring the SDK's own cleanup. Consumed callback params left in
|
|
1541
|
+
* the URL fail on reload with `STATE_MISMATCH_ERROR`: the one-time OAuth
|
|
1542
|
+
* `state` stored at authorize time was already consumed, so re-processing
|
|
1543
|
+
* fails state validation before any exchange is attempted.
|
|
1544
|
+
*/
|
|
1545
|
+
cleanUrl?: boolean | undefined;
|
|
1528
1546
|
}
|
|
1529
1547
|
/**
|
|
1530
1548
|
* Complete an OAuth authorization-code redirect.
|
|
@@ -1538,13 +1556,14 @@ interface HandleRedirectCallbackOptions {
|
|
|
1538
1556
|
* neither side has any state (a genuine no-state flow). Omitting the callback
|
|
1539
1557
|
* `state` does NOT bypass the check (#3841).
|
|
1540
1558
|
* 3. Retrieves the PKCE verifier and exchanges the code for tokens.
|
|
1541
|
-
* 4. On success, removes `code` + `state` from the browser URL
|
|
1559
|
+
* 4. On success, removes `code` + `state` from the browser URL (skipped when
|
|
1560
|
+
* `options.cleanUrl` is `false` — the consumer then owns URL cleanup).
|
|
1542
1561
|
*
|
|
1543
1562
|
* SSR-safe: when there is no `window` and no `options.url`, no exchange is
|
|
1544
1563
|
* attempted and an error result is returned.
|
|
1545
1564
|
*
|
|
1546
1565
|
* @param client - FFID client (or any object exposing exchangeCodeForTokens / createError / logger)
|
|
1547
|
-
* @param options - Optional callback URL override
|
|
1566
|
+
* @param options - Optional callback URL override and URL cleanup control (see {@link HandleRedirectCallbackOptions})
|
|
1548
1567
|
*/
|
|
1549
1568
|
declare function handleRedirectCallback(client: HandleRedirectCallbackClient, options?: HandleRedirectCallbackOptions): Promise<FFIDApiResponse<void>>;
|
|
1550
1569
|
|
|
@@ -1596,6 +1615,23 @@ declare function createKVCacheAdapter(kv: KVNamespaceLike): FFIDCacheAdapter;
|
|
|
1596
1615
|
interface FFIDProviderProps extends FFIDConfig {
|
|
1597
1616
|
/** Child components */
|
|
1598
1617
|
children: ReactNode;
|
|
1618
|
+
/**
|
|
1619
|
+
* Token mode only: whether the provider removes `code` / `state` from the
|
|
1620
|
+
* browser URL (`history.replaceState`) after a successful code exchange.
|
|
1621
|
+
* Defaults to `true`. Forwarded to
|
|
1622
|
+
* {@link HandleRedirectCallbackOptions.cleanUrl} — see its JSDoc for the
|
|
1623
|
+
* Next.js App Router background (#4254). Read once when the mount-time code
|
|
1624
|
+
* exchange runs; toggling it afterwards has no effect.
|
|
1625
|
+
*
|
|
1626
|
+
* Set to `false` on Next.js App Router when the patched history API
|
|
1627
|
+
* re-evaluating `useSearchParams()` (and re-running effects that depend on
|
|
1628
|
+
* it) is a problem — then remove `code` / `state` yourself (keeping other
|
|
1629
|
+
* query params) after authentication completes. Consumed callback params
|
|
1630
|
+
* left in the URL fail on reload with `STATE_MISMATCH_ERROR` (the one-time
|
|
1631
|
+
* OAuth `state` was already consumed), which also leaves an authenticated
|
|
1632
|
+
* user rendered as signed-out until the URL is cleaned.
|
|
1633
|
+
*/
|
|
1634
|
+
cleanCallbackUrl?: boolean | undefined;
|
|
1599
1635
|
}
|
|
1600
1636
|
/**
|
|
1601
1637
|
* FFIDProvider - Wrap your app to enable FFID authentication
|
|
@@ -1607,7 +1643,7 @@ interface FFIDProviderProps extends FFIDConfig {
|
|
|
1607
1643
|
* - Automatic session refresh
|
|
1608
1644
|
* - Token mode: automatic code exchange and token refresh
|
|
1609
1645
|
*/
|
|
1610
|
-
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
1646
|
+
declare function FFIDProvider({ children, serviceCode, scope, apiBaseUrl, debug, logger, refreshInterval, onAuthStateChange, onError, authMode, clientId, cleanCallbackUrl, }: FFIDProviderProps): react_jsx_runtime.JSX.Element;
|
|
1611
1647
|
|
|
1612
1648
|
/**
|
|
1613
1649
|
* Return type for useFFID hook
|
|
@@ -2280,4 +2316,4 @@ declare function createInquiryMethods(deps: InquiryMethodsDeps): {
|
|
|
2280
2316
|
};
|
|
2281
2317
|
type FFIDInquiryClient = ReturnType<typeof createInquiryMethods>;
|
|
2282
2318
|
|
|
2283
|
-
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
|
2319
|
+
export { ACCESS_GRANTING_EFFECTIVE_STATUSES, AnnouncementListResponse, BLOCKING_EFFECTIVE_STATUSES, type ComputeEffectiveStatusInput, type ContractWizardFlowType, type ContractWizardResubscribeOptions, type ContractWizardSubscribeOptions, type ContractWizardSubscriptionOptions, DEFAULT_API_BASE_URL, DEFAULT_OAUTH_SCOPES, EffectiveSubscriptionStatus, type ExchangeCodeForTokensOptions, type FFIDAddMemberParams, type FFIDAddMemberRequest, type FFIDAddMemberResponse, FFIDAnnouncementsApiResponse, type FFIDAnnouncementsClient, FFIDAnnouncementsClientConfig, FFIDAnnouncementsLogger, FFIDApiResponse, type FFIDAssignableMemberRole, type FFIDBillingInterval, FFIDCacheAdapter, type FFIDCancelPendingDowngradeResponse, type FFIDCancelSubscriptionParams, type FFIDCancelSubscriptionResponse, type FFIDChangePlanParams, type FFIDChangePlanResponse, FFIDCheckServiceAccessParams, type FFIDCheckoutSessionResponse, type FFIDClient, FFIDConfig, type FFIDCreateCheckoutParams, type FFIDCreatePortalParams, FFIDError, type FFIDErrorCode, type FFIDInquiryClient, FFIDInquiryCreateParams, FFIDInquiryCreateResponse, type FFIDInvitationStatus, type FFIDInviteMemberRequest, type FFIDInviteMemberResponse, type FFIDLeaveOrganizationParams, type FFIDLeaveOrganizationResponse, type FFIDListMembersResponse, type FFIDListPlansResponse, FFIDLogger, type FFIDLoginHistoryEntry, type FFIDLoginHistoryResponse, type FFIDMemberRole, type FFIDMemberStatus, type FFIDNewsletterBodySource, type FFIDNewsletterCampaignStatus, type FFIDNewsletterClient, type FFIDNewsletterConfirmParams, type FFIDNewsletterConfirmResponse, type FFIDNewsletterDispatchParams, type FFIDNewsletterDispatchResponse, type FFIDNewsletterSegment, type FFIDNewsletterSubscribeParams, type FFIDNewsletterSubscribeResponse, type FFIDNewsletterType, type FFIDNewsletterUnsubscribeParams, type FFIDNewsletterUnsubscribeResponse, FFIDOAuthUserInfo, FFIDOAuthUserInfoSubscription, FFIDOrganization, type FFIDOrganizationDomain, type FFIDOrganizationDomainsResponse, type FFIDOrganizationMember, type FFIDOrganizationNotificationPreferences, type FFIDOrganizationNotificationPreferencesResponse, type FFIDOtpSendResponse, type FFIDOtpVerifyResponse, type FFIDPasswordResetConfirmResponse, type FFIDPasswordResetResponse, type FFIDPasswordResetVerifyResponse, type FFIDPlanChangeLineItem, type FFIDPlanChangePreview, type FFIDPlanChangePreviewResponse, type FFIDPlanInfo, type FFIDPortalSessionResponse, type FFIDPreviewPlanChangeParams, type FFIDPreviewSeatChangeParams, type FFIDProfileCallOptions, FFIDProvider, type FFIDProviderProps, type FFIDProvisionMemberPlan, type FFIDProvisionMemberPlanStatus, type FFIDProvisionMemberResult, type FFIDProvisionMemberStatus, type FFIDProvisionOrganizationDryRun, type FFIDProvisionOrganizationMemberInput, type FFIDProvisionOrganizationOutcome, type FFIDProvisionOrganizationParams, type FFIDProvisionOrganizationResponse, type FFIDProvisionUserDryRun, type FFIDProvisionUserOutcome, type FFIDProvisionUserParams, type FFIDProvisionUserProfileInput, type FFIDProvisionUserResponse, type FFIDProvisionedOrganization, type FFIDProvisionedUser, FFIDRedirectResult, type FFIDRemoveMemberResponse, type FFIDResetSessionResponse, FFIDSDKError, type FFIDSeatChangeLineItem, type FFIDSeatChangePreview, type FFIDSeatChangePreviewResponse, FFIDServiceAccessDecision, type FFIDServiceInfo, FFIDSessionResponse, FFIDSignOutResult, type FFIDSubscribeParams, type FFIDSubscribeResponse, FFIDSubscription, FFIDSubscriptionCheckResponse, FFIDSubscriptionContextValue, type FFIDSubscriptionDetail, FFIDSubscriptionStatus, type FFIDSubscriptionSummary, type FFIDSupportedCurrency, type FFIDUpdateMemberRoleResponse, type FFIDUpdateNotificationPreferencesRequest, type FFIDUpdateUserProfileRequest, FFIDUser, type FFIDUserProfile, FFIDVerifyAccessTokenOptions, FFID_ANNOUNCEMENTS_ERROR_CODES, FFID_ERROR_CODES, FFID_NEWSLETTER_DISPATCH_MAX_RECIPIENTS, FFID_NEWSLETTER_TYPES, type HandleRedirectCallbackClient, type HandleRedirectCallbackOptions, type KVNamespaceLike, ListAnnouncementsOptions, type NormalizeRedirectUriResult, type RedirectToAuthorizeOptions, type TokenData, type TokenStore, type UseFFIDReturn, type UseRequireActiveSubscriptionOptions, type UseRequireActiveSubscriptionReturn, type WithFFIDAuthOptions, type WithSubscriptionOptions, cleanupStateStorage as clearState, computeEffectiveStatusFromSession, createFFIDAnnouncementsClient, createFFIDClient, createKVCacheAdapter, createMemoryCacheAdapter, createTokenStore, generateCodeChallenge, generateCodeVerifier, handleRedirectCallback, hasAccessFromUserinfo, isBlockedFromUserinfo, normalizeRedirectUri, retrieveCodeVerifier, retrieveState, storeCodeVerifier, storeState, useFFID, useRequireActiveSubscription, useSubscription, withFFIDAuth, withSubscription };
|
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-7NRO2TBG.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-7NRO2TBG.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/legal/index.cjs
CHANGED
package/dist/legal/index.js
CHANGED