@feelflow/ffid-sdk 5.16.2 → 5.17.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-C7PURRNI.js → chunk-26X62P76.js} +24 -10
- package/dist/{chunk-FLLTPPUP.cjs → chunk-A2KK6L63.cjs} +24 -10
- 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-CKFxY60u.d.cts → ffid-client-Cwk6cG3b.d.cts} +47 -5
- package/dist/{ffid-client-9-lh0G_h.d.ts → ffid-client-w8Twi5lD.d.ts} +47 -5
- package/dist/{index-CsVJTuPv.d.cts → index-Bkul-fRw.d.cts} +33 -5
- package/dist/{index-CsVJTuPv.d.ts → index-Bkul-fRw.d.ts} +33 -5
- package/dist/index.cjs +41 -41
- package/dist/index.d.cts +47 -4
- package/dist/index.d.ts +47 -4
- package/dist/index.js +2 -2
- package/dist/server/index.cjs +21 -10
- package/dist/server/index.d.cts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +21 -10
- package/dist/server/test/index.d.cts +1 -1
- package/dist/server/test/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -115,10 +115,13 @@ function hasOwnKey(value, key) {
|
|
|
115
115
|
function normalizeUserinfo(raw) {
|
|
116
116
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
117
117
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
const hasOrganizationMemberRole = hasOwnKey(raw, "organization_member_role");
|
|
119
|
+
const organizationMemberRole = hasOrganizationMemberRole ? raw.organization_member_role ?? null : raw.subscription ? raw.subscription.member_role ?? null : void 0;
|
|
120
|
+
const organizationFields = {
|
|
121
|
+
...hasOrganizationId ? { organizationId: raw.organization_id ?? null } : {},
|
|
122
|
+
...hasOrganizationId || hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {},
|
|
123
|
+
...organizationMemberRole !== void 0 ? { organizationMemberRole } : {}
|
|
124
|
+
};
|
|
122
125
|
return {
|
|
123
126
|
sub: raw.sub,
|
|
124
127
|
email: raw.email,
|
|
@@ -1093,7 +1096,7 @@ function createNonContractMethods(deps) {
|
|
|
1093
1096
|
}
|
|
1094
1097
|
|
|
1095
1098
|
// src/client/version-check.ts
|
|
1096
|
-
var SDK_VERSION = "5.
|
|
1099
|
+
var SDK_VERSION = "5.17.1";
|
|
1097
1100
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1098
1101
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1099
1102
|
function sdkHeaders() {
|
|
@@ -1939,6 +1942,9 @@ function createRedirectMethods(deps) {
|
|
|
1939
1942
|
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1940
1943
|
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1941
1944
|
}
|
|
1945
|
+
if (options?.prompt) {
|
|
1946
|
+
params.set("prompt", options.prompt);
|
|
1947
|
+
}
|
|
1942
1948
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1943
1949
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1944
1950
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1958,12 +1964,12 @@ function createRedirectMethods(deps) {
|
|
|
1958
1964
|
if (authMode === "token") {
|
|
1959
1965
|
return redirectToAuthorize(options);
|
|
1960
1966
|
}
|
|
1961
|
-
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1967
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl(void 0, options?.prompt ? { prompt: options.prompt } : void 0);
|
|
1962
1968
|
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1963
1969
|
window.location.href = targetUrl;
|
|
1964
1970
|
return { success: true };
|
|
1965
1971
|
}
|
|
1966
|
-
function getLoginUrl(redirectUrl) {
|
|
1972
|
+
function getLoginUrl(redirectUrl, options) {
|
|
1967
1973
|
let redirect;
|
|
1968
1974
|
if (redirectUrl != null) {
|
|
1969
1975
|
redirect = redirectUrl;
|
|
@@ -1973,7 +1979,8 @@ function createRedirectMethods(deps) {
|
|
|
1973
1979
|
logger.warn("getLoginUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
|
|
1974
1980
|
redirect = "";
|
|
1975
1981
|
}
|
|
1976
|
-
|
|
1982
|
+
const promptSuffix = options?.prompt ? `&prompt=${encodeURIComponent(options.prompt)}` : "";
|
|
1983
|
+
return `${baseUrl}/login?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}${promptSuffix}`;
|
|
1977
1984
|
}
|
|
1978
1985
|
function getSignupUrl(redirectUrl) {
|
|
1979
1986
|
let redirect;
|
|
@@ -2005,7 +2012,10 @@ function createRedirectMethods(deps) {
|
|
|
2005
2012
|
window.location.href = logoutUrl;
|
|
2006
2013
|
return { success: true };
|
|
2007
2014
|
}
|
|
2008
|
-
|
|
2015
|
+
async function switchAccount(options) {
|
|
2016
|
+
return redirectToLogin({ ...options, prompt: "select_account" });
|
|
2017
|
+
}
|
|
2018
|
+
return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount };
|
|
2009
2019
|
}
|
|
2010
2020
|
|
|
2011
2021
|
// src/client/redirect-uri.ts
|
|
@@ -2979,7 +2989,7 @@ function createFFIDClient(config) {
|
|
|
2979
2989
|
}
|
|
2980
2990
|
return signOutCookie();
|
|
2981
2991
|
}
|
|
2982
|
-
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout } = createRedirectMethods({
|
|
2992
|
+
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount } = createRedirectMethods({
|
|
2983
2993
|
authMode,
|
|
2984
2994
|
baseUrl,
|
|
2985
2995
|
clientId,
|
|
@@ -3173,6 +3183,7 @@ function createFFIDClient(config) {
|
|
|
3173
3183
|
redirectToLogin,
|
|
3174
3184
|
redirectToAuthorize,
|
|
3175
3185
|
redirectToLogout,
|
|
3186
|
+
switchAccount,
|
|
3176
3187
|
getLoginUrl,
|
|
3177
3188
|
getLogoutUrl,
|
|
3178
3189
|
getSignupUrl,
|
|
@@ -3629,6 +3640,9 @@ function useFFID() {
|
|
|
3629
3640
|
error: context.error,
|
|
3630
3641
|
login: context.login,
|
|
3631
3642
|
logout: context.logout,
|
|
3643
|
+
getLogoutUrl: client.getLogoutUrl,
|
|
3644
|
+
redirectToLogout: client.redirectToLogout,
|
|
3645
|
+
switchAccount: client.switchAccount,
|
|
3632
3646
|
switchOrganization: context.switchOrganization,
|
|
3633
3647
|
refresh: context.refresh,
|
|
3634
3648
|
getLoginUrl: client.getLoginUrl,
|
|
@@ -117,10 +117,13 @@ function hasOwnKey(value, key) {
|
|
|
117
117
|
function normalizeUserinfo(raw) {
|
|
118
118
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
119
119
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
const hasOrganizationMemberRole = hasOwnKey(raw, "organization_member_role");
|
|
121
|
+
const organizationMemberRole = hasOrganizationMemberRole ? raw.organization_member_role ?? null : raw.subscription ? raw.subscription.member_role ?? null : void 0;
|
|
122
|
+
const organizationFields = {
|
|
123
|
+
...hasOrganizationId ? { organizationId: raw.organization_id ?? null } : {},
|
|
124
|
+
...hasOrganizationId || hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {},
|
|
125
|
+
...organizationMemberRole !== void 0 ? { organizationMemberRole } : {}
|
|
126
|
+
};
|
|
124
127
|
return {
|
|
125
128
|
sub: raw.sub,
|
|
126
129
|
email: raw.email,
|
|
@@ -1095,7 +1098,7 @@ function createNonContractMethods(deps) {
|
|
|
1095
1098
|
}
|
|
1096
1099
|
|
|
1097
1100
|
// src/client/version-check.ts
|
|
1098
|
-
var SDK_VERSION = "5.
|
|
1101
|
+
var SDK_VERSION = "5.17.1";
|
|
1099
1102
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1100
1103
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1101
1104
|
function sdkHeaders() {
|
|
@@ -1941,6 +1944,9 @@ function createRedirectMethods(deps) {
|
|
|
1941
1944
|
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1942
1945
|
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1943
1946
|
}
|
|
1947
|
+
if (options?.prompt) {
|
|
1948
|
+
params.set("prompt", options.prompt);
|
|
1949
|
+
}
|
|
1944
1950
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1945
1951
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1946
1952
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1960,12 +1966,12 @@ function createRedirectMethods(deps) {
|
|
|
1960
1966
|
if (authMode === "token") {
|
|
1961
1967
|
return redirectToAuthorize(options);
|
|
1962
1968
|
}
|
|
1963
|
-
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1969
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl(void 0, options?.prompt ? { prompt: options.prompt } : void 0);
|
|
1964
1970
|
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1965
1971
|
window.location.href = targetUrl;
|
|
1966
1972
|
return { success: true };
|
|
1967
1973
|
}
|
|
1968
|
-
function getLoginUrl(redirectUrl) {
|
|
1974
|
+
function getLoginUrl(redirectUrl, options) {
|
|
1969
1975
|
let redirect;
|
|
1970
1976
|
if (redirectUrl != null) {
|
|
1971
1977
|
redirect = redirectUrl;
|
|
@@ -1975,7 +1981,8 @@ function createRedirectMethods(deps) {
|
|
|
1975
1981
|
logger.warn("getLoginUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
|
|
1976
1982
|
redirect = "";
|
|
1977
1983
|
}
|
|
1978
|
-
|
|
1984
|
+
const promptSuffix = options?.prompt ? `&prompt=${encodeURIComponent(options.prompt)}` : "";
|
|
1985
|
+
return `${baseUrl}/login?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}${promptSuffix}`;
|
|
1979
1986
|
}
|
|
1980
1987
|
function getSignupUrl(redirectUrl) {
|
|
1981
1988
|
let redirect;
|
|
@@ -2007,7 +2014,10 @@ function createRedirectMethods(deps) {
|
|
|
2007
2014
|
window.location.href = logoutUrl;
|
|
2008
2015
|
return { success: true };
|
|
2009
2016
|
}
|
|
2010
|
-
|
|
2017
|
+
async function switchAccount(options) {
|
|
2018
|
+
return redirectToLogin({ ...options, prompt: "select_account" });
|
|
2019
|
+
}
|
|
2020
|
+
return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount };
|
|
2011
2021
|
}
|
|
2012
2022
|
|
|
2013
2023
|
// src/client/redirect-uri.ts
|
|
@@ -2981,7 +2991,7 @@ function createFFIDClient(config) {
|
|
|
2981
2991
|
}
|
|
2982
2992
|
return signOutCookie();
|
|
2983
2993
|
}
|
|
2984
|
-
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout } = createRedirectMethods({
|
|
2994
|
+
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount } = createRedirectMethods({
|
|
2985
2995
|
authMode,
|
|
2986
2996
|
baseUrl,
|
|
2987
2997
|
clientId,
|
|
@@ -3175,6 +3185,7 @@ function createFFIDClient(config) {
|
|
|
3175
3185
|
redirectToLogin,
|
|
3176
3186
|
redirectToAuthorize,
|
|
3177
3187
|
redirectToLogout,
|
|
3188
|
+
switchAccount,
|
|
3178
3189
|
getLoginUrl,
|
|
3179
3190
|
getLogoutUrl,
|
|
3180
3191
|
getSignupUrl,
|
|
@@ -3631,6 +3642,9 @@ function useFFID() {
|
|
|
3631
3642
|
error: context.error,
|
|
3632
3643
|
login: context.login,
|
|
3633
3644
|
logout: context.logout,
|
|
3645
|
+
getLogoutUrl: client.getLogoutUrl,
|
|
3646
|
+
redirectToLogout: client.redirectToLogout,
|
|
3647
|
+
switchAccount: client.switchAccount,
|
|
3634
3648
|
switchOrganization: context.switchOrganization,
|
|
3635
3649
|
refresh: context.refresh,
|
|
3636
3650
|
getLoginUrl: client.getLoginUrl,
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA2KK6L63_cjs = require('../chunk-A2KK6L63.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 chunkA2KK6L63_cjs.FFIDAnnouncementBadge; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDAnnouncementList; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDInquiryForm; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDLoginButton; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDOrganizationSwitcher; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDSubscriptionBadge; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDUserMenu; }
|
|
34
34
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { G as FFIDAnnouncementBadge, ag as FFIDAnnouncementBadgeClassNames, ah as FFIDAnnouncementBadgeProps, H as FFIDAnnouncementList, ai as FFIDAnnouncementListClassNames, aj as FFIDAnnouncementListProps, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, $ as FFIDLoginButton, ak as FFIDLoginButtonProps, a2 as FFIDOrganizationSwitcher, al as FFIDOrganizationSwitcherClassNames, am as FFIDOrganizationSwitcherProps, a7 as FFIDSubscriptionBadge, an as FFIDSubscriptionBadgeClassNames, ao as FFIDSubscriptionBadgeProps, a9 as FFIDUserMenu, ap as FFIDUserMenuClassNames, aq as FFIDUserMenuProps } from '../index-Bkul-fRw.cjs';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { G as FFIDAnnouncementBadge, ag as FFIDAnnouncementBadgeClassNames, ah as FFIDAnnouncementBadgeProps, H as FFIDAnnouncementList, ai as FFIDAnnouncementListClassNames, aj as FFIDAnnouncementListProps, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, $ as FFIDLoginButton, ak as FFIDLoginButtonProps, a2 as FFIDOrganizationSwitcher, al as FFIDOrganizationSwitcherClassNames, am as FFIDOrganizationSwitcherProps, a7 as FFIDSubscriptionBadge, an as FFIDSubscriptionBadgeClassNames, ao as FFIDSubscriptionBadgeProps, a9 as FFIDUserMenu, ap as FFIDUserMenuClassNames, aq as FFIDUserMenuProps } from '../index-Bkul-fRw.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'react';
|
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-26X62P76.js';
|
|
@@ -1240,10 +1240,12 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
1240
1240
|
/**
|
|
1241
1241
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
1242
1242
|
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
1243
|
-
* `organizationId`, and `
|
|
1244
|
-
* (FFID #3380, requires
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1243
|
+
* `organizationId`, `organizationName`, and `organizationMemberRole` are
|
|
1244
|
+
* scope-gated on `/oauth/userinfo` (FFID #3380 / #4060, requires
|
|
1245
|
+
* `subscription:read`); JWT verification without `includeProfile`
|
|
1246
|
+
* additionally omits `subscription`, `organizationName`, and
|
|
1247
|
+
* `organizationMemberRole` because the JWT has `org_id` but no `org_name`
|
|
1248
|
+
* or membership-role claim.
|
|
1247
1249
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
1248
1250
|
*/
|
|
1249
1251
|
interface FFIDOAuthUserInfo {
|
|
@@ -1280,6 +1282,19 @@ interface FFIDOAuthUserInfo {
|
|
|
1280
1282
|
* claim.
|
|
1281
1283
|
*/
|
|
1282
1284
|
organizationName?: string | null | undefined;
|
|
1285
|
+
/**
|
|
1286
|
+
* Organization membership role, `null` if FFID cannot resolve a role for the
|
|
1287
|
+
* selected organization, or `undefined` if the granted scope omits
|
|
1288
|
+
* `subscription:read` on `/oauth/userinfo` (FFID #4060), or if the caller
|
|
1289
|
+
* used JWT verification without `includeProfile`. JWT payloads carry
|
|
1290
|
+
* `org_id` but no membership-role claim.
|
|
1291
|
+
*
|
|
1292
|
+
* This duplicates `subscription.memberRole` at the top level so consumers can
|
|
1293
|
+
* sync `(organizationId, organizationMemberRole)` without unpacking the full
|
|
1294
|
+
* subscription blob. Older FFID responses that omit the top-level wire field
|
|
1295
|
+
* are normalized from `subscription.member_role` when available.
|
|
1296
|
+
*/
|
|
1297
|
+
organizationMemberRole?: FFIDOAuthUserInfoMemberRole | null | undefined;
|
|
1283
1298
|
/**
|
|
1284
1299
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
1285
1300
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -1380,6 +1395,14 @@ interface FFIDConfig {
|
|
|
1380
1395
|
*/
|
|
1381
1396
|
timeout?: number | undefined;
|
|
1382
1397
|
}
|
|
1398
|
+
/**
|
|
1399
|
+
* OIDC `prompt` values the SDK forwards to FFID `/oauth/authorize` (#4027).
|
|
1400
|
+
*
|
|
1401
|
+
* - `select_account`: force the upstream IdP (Google) account chooser so RP-initiated
|
|
1402
|
+
* account switching is not silently re-authenticated against the residual session.
|
|
1403
|
+
* - `login`: force re-authentication (FFID `/login` is shown even with an active session).
|
|
1404
|
+
*/
|
|
1405
|
+
type FFIDPrompt = 'select_account' | 'login';
|
|
1383
1406
|
/**
|
|
1384
1407
|
* Logger interface for SDK debug output
|
|
1385
1408
|
*
|
|
@@ -1653,6 +1676,20 @@ interface RedirectToAuthorizeOptions {
|
|
|
1653
1676
|
* regardless of `authMode`.
|
|
1654
1677
|
*/
|
|
1655
1678
|
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1679
|
+
/**
|
|
1680
|
+
* OIDC `prompt` to forward to FFID `/oauth/authorize` (#4027).
|
|
1681
|
+
*
|
|
1682
|
+
* - `'select_account'`: forwards `prompt=select_account` so the upstream IdP
|
|
1683
|
+
* (Google) account chooser is shown — used by {@link switchAccount} to enable
|
|
1684
|
+
* RP-initiated account switching after logout (residual upstream sessions would
|
|
1685
|
+
* otherwise auto-re-authenticate the same account).
|
|
1686
|
+
* - `'login'`: forces re-authentication (FFID `/login` is shown even with an
|
|
1687
|
+
* active session).
|
|
1688
|
+
*
|
|
1689
|
+
* Token mode: added to the `/oauth/authorize` query. Cookie mode: forwarded as
|
|
1690
|
+
* `?prompt=…` on the `/login` URL (ignored for the signup screen).
|
|
1691
|
+
*/
|
|
1692
|
+
prompt?: FFIDPrompt;
|
|
1656
1693
|
}
|
|
1657
1694
|
|
|
1658
1695
|
/** Creates an FFID API client instance */
|
|
@@ -1662,7 +1699,12 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1662
1699
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1663
1700
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1664
1701
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1665
|
-
|
|
1702
|
+
switchAccount: (options?: {
|
|
1703
|
+
organizationId?: string;
|
|
1704
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1705
|
+
getLoginUrl: (redirectUrl?: string, options?: {
|
|
1706
|
+
prompt?: FFIDPrompt;
|
|
1707
|
+
}) => string;
|
|
1666
1708
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1667
1709
|
getSignupUrl: (redirectUrl?: string) => string;
|
|
1668
1710
|
createError: (code: string, message: string) => FFIDError;
|
|
@@ -1240,10 +1240,12 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
1240
1240
|
/**
|
|
1241
1241
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
1242
1242
|
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
1243
|
-
* `organizationId`, and `
|
|
1244
|
-
* (FFID #3380, requires
|
|
1245
|
-
*
|
|
1246
|
-
*
|
|
1243
|
+
* `organizationId`, `organizationName`, and `organizationMemberRole` are
|
|
1244
|
+
* scope-gated on `/oauth/userinfo` (FFID #3380 / #4060, requires
|
|
1245
|
+
* `subscription:read`); JWT verification without `includeProfile`
|
|
1246
|
+
* additionally omits `subscription`, `organizationName`, and
|
|
1247
|
+
* `organizationMemberRole` because the JWT has `org_id` but no `org_name`
|
|
1248
|
+
* or membership-role claim.
|
|
1247
1249
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
1248
1250
|
*/
|
|
1249
1251
|
interface FFIDOAuthUserInfo {
|
|
@@ -1280,6 +1282,19 @@ interface FFIDOAuthUserInfo {
|
|
|
1280
1282
|
* claim.
|
|
1281
1283
|
*/
|
|
1282
1284
|
organizationName?: string | null | undefined;
|
|
1285
|
+
/**
|
|
1286
|
+
* Organization membership role, `null` if FFID cannot resolve a role for the
|
|
1287
|
+
* selected organization, or `undefined` if the granted scope omits
|
|
1288
|
+
* `subscription:read` on `/oauth/userinfo` (FFID #4060), or if the caller
|
|
1289
|
+
* used JWT verification without `includeProfile`. JWT payloads carry
|
|
1290
|
+
* `org_id` but no membership-role claim.
|
|
1291
|
+
*
|
|
1292
|
+
* This duplicates `subscription.memberRole` at the top level so consumers can
|
|
1293
|
+
* sync `(organizationId, organizationMemberRole)` without unpacking the full
|
|
1294
|
+
* subscription blob. Older FFID responses that omit the top-level wire field
|
|
1295
|
+
* are normalized from `subscription.member_role` when available.
|
|
1296
|
+
*/
|
|
1297
|
+
organizationMemberRole?: FFIDOAuthUserInfoMemberRole | null | undefined;
|
|
1283
1298
|
/**
|
|
1284
1299
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
1285
1300
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -1380,6 +1395,14 @@ interface FFIDConfig {
|
|
|
1380
1395
|
*/
|
|
1381
1396
|
timeout?: number | undefined;
|
|
1382
1397
|
}
|
|
1398
|
+
/**
|
|
1399
|
+
* OIDC `prompt` values the SDK forwards to FFID `/oauth/authorize` (#4027).
|
|
1400
|
+
*
|
|
1401
|
+
* - `select_account`: force the upstream IdP (Google) account chooser so RP-initiated
|
|
1402
|
+
* account switching is not silently re-authenticated against the residual session.
|
|
1403
|
+
* - `login`: force re-authentication (FFID `/login` is shown even with an active session).
|
|
1404
|
+
*/
|
|
1405
|
+
type FFIDPrompt = 'select_account' | 'login';
|
|
1383
1406
|
/**
|
|
1384
1407
|
* Logger interface for SDK debug output
|
|
1385
1408
|
*
|
|
@@ -1653,6 +1676,20 @@ interface RedirectToAuthorizeOptions {
|
|
|
1653
1676
|
* regardless of `authMode`.
|
|
1654
1677
|
*/
|
|
1655
1678
|
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1679
|
+
/**
|
|
1680
|
+
* OIDC `prompt` to forward to FFID `/oauth/authorize` (#4027).
|
|
1681
|
+
*
|
|
1682
|
+
* - `'select_account'`: forwards `prompt=select_account` so the upstream IdP
|
|
1683
|
+
* (Google) account chooser is shown — used by {@link switchAccount} to enable
|
|
1684
|
+
* RP-initiated account switching after logout (residual upstream sessions would
|
|
1685
|
+
* otherwise auto-re-authenticate the same account).
|
|
1686
|
+
* - `'login'`: forces re-authentication (FFID `/login` is shown even with an
|
|
1687
|
+
* active session).
|
|
1688
|
+
*
|
|
1689
|
+
* Token mode: added to the `/oauth/authorize` query. Cookie mode: forwarded as
|
|
1690
|
+
* `?prompt=…` on the `/login` URL (ignored for the signup screen).
|
|
1691
|
+
*/
|
|
1692
|
+
prompt?: FFIDPrompt;
|
|
1656
1693
|
}
|
|
1657
1694
|
|
|
1658
1695
|
/** Creates an FFID API client instance */
|
|
@@ -1662,7 +1699,12 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1662
1699
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1663
1700
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1664
1701
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1665
|
-
|
|
1702
|
+
switchAccount: (options?: {
|
|
1703
|
+
organizationId?: string;
|
|
1704
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1705
|
+
getLoginUrl: (redirectUrl?: string, options?: {
|
|
1706
|
+
prompt?: FFIDPrompt;
|
|
1707
|
+
}) => string;
|
|
1666
1708
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1667
1709
|
getSignupUrl: (redirectUrl?: string) => string;
|
|
1668
1710
|
createError: (code: string, message: string) => FFIDError;
|
|
@@ -316,10 +316,12 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
316
316
|
/**
|
|
317
317
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
318
318
|
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
319
|
-
* `organizationId`, and `
|
|
320
|
-
* (FFID #3380, requires
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* `organizationId`, `organizationName`, and `organizationMemberRole` are
|
|
320
|
+
* scope-gated on `/oauth/userinfo` (FFID #3380 / #4060, requires
|
|
321
|
+
* `subscription:read`); JWT verification without `includeProfile`
|
|
322
|
+
* additionally omits `subscription`, `organizationName`, and
|
|
323
|
+
* `organizationMemberRole` because the JWT has `org_id` but no `org_name`
|
|
324
|
+
* or membership-role claim.
|
|
323
325
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
324
326
|
*/
|
|
325
327
|
interface FFIDOAuthUserInfo {
|
|
@@ -356,6 +358,19 @@ interface FFIDOAuthUserInfo {
|
|
|
356
358
|
* claim.
|
|
357
359
|
*/
|
|
358
360
|
organizationName?: string | null | undefined;
|
|
361
|
+
/**
|
|
362
|
+
* Organization membership role, `null` if FFID cannot resolve a role for the
|
|
363
|
+
* selected organization, or `undefined` if the granted scope omits
|
|
364
|
+
* `subscription:read` on `/oauth/userinfo` (FFID #4060), or if the caller
|
|
365
|
+
* used JWT verification without `includeProfile`. JWT payloads carry
|
|
366
|
+
* `org_id` but no membership-role claim.
|
|
367
|
+
*
|
|
368
|
+
* This duplicates `subscription.memberRole` at the top level so consumers can
|
|
369
|
+
* sync `(organizationId, organizationMemberRole)` without unpacking the full
|
|
370
|
+
* subscription blob. Older FFID responses that omit the top-level wire field
|
|
371
|
+
* are normalized from `subscription.member_role` when available.
|
|
372
|
+
*/
|
|
373
|
+
organizationMemberRole?: FFIDOAuthUserInfoMemberRole | null | undefined;
|
|
359
374
|
/**
|
|
360
375
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
361
376
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -483,6 +498,14 @@ interface FFIDJwtClaims {
|
|
|
483
498
|
/** Service UUID */
|
|
484
499
|
svc_id: string;
|
|
485
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* OIDC `prompt` values the SDK forwards to FFID `/oauth/authorize` (#4027).
|
|
503
|
+
*
|
|
504
|
+
* - `select_account`: force the upstream IdP (Google) account chooser so RP-initiated
|
|
505
|
+
* account switching is not silently re-authenticated against the residual session.
|
|
506
|
+
* - `login`: force re-authentication (FFID `/login` is shown even with an active session).
|
|
507
|
+
*/
|
|
508
|
+
type FFIDPrompt = 'select_account' | 'login';
|
|
486
509
|
/**
|
|
487
510
|
* FFID context value provided to consumers
|
|
488
511
|
*/
|
|
@@ -508,9 +531,14 @@ interface FFIDContextValue {
|
|
|
508
531
|
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
509
532
|
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
510
533
|
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
534
|
+
* @param options.prompt OIDC `prompt` to forward to FFID `/oauth/authorize`
|
|
535
|
+
* (e.g. `'select_account'` to force the upstream account chooser). See
|
|
536
|
+
* {@link FFIDPrompt} (#4027). Prefer {@link FFIDContextValue} consumers use
|
|
537
|
+
* the dedicated `switchAccount()` helper on `useFFID()` for account switching.
|
|
511
538
|
*/
|
|
512
539
|
login: (options?: {
|
|
513
540
|
screenHint?: 'signup' | 'login';
|
|
541
|
+
prompt?: FFIDPrompt;
|
|
514
542
|
}) => void;
|
|
515
543
|
/** Sign out and clear session */
|
|
516
544
|
logout: () => Promise<void>;
|
|
@@ -1448,4 +1476,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1448
1476
|
}
|
|
1449
1477
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1450
1478
|
|
|
1451
|
-
export {
|
|
1479
|
+
export { FFIDLoginButton as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, EFFECTIVE_SUBSCRIPTION_STATUSES as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementBadge as G, FFIDAnnouncementList as H, type FFIDAnnouncementsError as I, type FFIDAnnouncementsErrorCode as J, type FFIDAnnouncementsServerResponse as K, type ListAnnouncementsOptions as L, type FFIDCacheConfig as M, type FFIDContextValue as N, type FFIDInquiryCategory as O, type FFIDInquiryCategorySite2026 as P, FFIDInquiryForm as Q, type FFIDInquiryFormCategoryItem as R, type FFIDInquiryFormClassNames as S, type FFIDInquiryFormLegalLayout as T, type FFIDInquiryFormOrganization as U, type FFIDInquiryFormPlaceholderContext as V, type FFIDInquiryFormPrefill as W, type FFIDInquiryFormProps as X, type FFIDInquiryFormSubmitData as Y, type FFIDInquiryFormSubmitResult as Z, type FFIDJwtClaims as _, type FFIDPrompt as a, type FFIDOAuthTokenResponse as a0, type FFIDOAuthUserInfoMemberRole as a1, FFIDOrganizationSwitcher as a2, type FFIDRedirectErrorCode as a3, type FFIDSeatModel as a4, type FFIDServiceAccessDenialReason as a5, type FFIDServiceAccessFailPolicy as a6, FFIDSubscriptionBadge as a7, type FFIDTokenIntrospectionResponse as a8, FFIDUserMenu as a9, FFID_INQUIRY_CATEGORIES as aa, FFID_INQUIRY_CATEGORIES_SITE_2026 as ab, type UseFFIDAnnouncementsOptions as ac, type UseFFIDAnnouncementsReturn as ad, isFFIDInquiryCategorySite2026 as ae, useFFIDAnnouncements as af, type FFIDAnnouncementBadgeClassNames as ag, type FFIDAnnouncementBadgeProps as ah, type FFIDAnnouncementListClassNames as ai, type FFIDAnnouncementListProps as aj, type FFIDLoginButtonProps as ak, type FFIDOrganizationSwitcherClassNames as al, type FFIDOrganizationSwitcherProps as am, type FFIDSubscriptionBadgeClassNames as an, type FFIDSubscriptionBadgeProps as ao, type FFIDUserMenuClassNames as ap, type FFIDUserMenuProps as aq, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDRedirectResult as e, type FFIDError as f, type FFIDSubscriptionCheckResponse as g, type FFIDCheckServiceAccessParams as h, type FFIDServiceAccessDecision as i, type FFIDAnalyticsConfig as j, type FFIDVerifyAccessTokenOptions as k, type FFIDOAuthUserInfo as l, type FFIDInquiryCreateParams as m, type FFIDInquiryCreateResponse as n, type FFIDAuthMode as o, type FFIDLogger as p, type FFIDCacheAdapter as q, type FFIDUser as r, type FFIDOrganization as s, type FFIDSubscription as t, type FFIDSubscriptionContextValue as u, type FFIDOAuthUserInfoSubscription as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
|
|
@@ -316,10 +316,12 @@ interface FFIDOAuthUserInfoSubscription {
|
|
|
316
316
|
/**
|
|
317
317
|
* Unified user-identity shape returned by `getSession()` (→ `/oauth/userinfo`)
|
|
318
318
|
* and `verifyAccessToken()` (JWT or introspect path). `subscription`,
|
|
319
|
-
* `organizationId`, and `
|
|
320
|
-
* (FFID #3380, requires
|
|
321
|
-
*
|
|
322
|
-
*
|
|
319
|
+
* `organizationId`, `organizationName`, and `organizationMemberRole` are
|
|
320
|
+
* scope-gated on `/oauth/userinfo` (FFID #3380 / #4060, requires
|
|
321
|
+
* `subscription:read`); JWT verification without `includeProfile`
|
|
322
|
+
* additionally omits `subscription`, `organizationName`, and
|
|
323
|
+
* `organizationMemberRole` because the JWT has `org_id` but no `org_name`
|
|
324
|
+
* or membership-role claim.
|
|
323
325
|
* See per-field JSDoc — misreading `undefined` is a security regression.
|
|
324
326
|
*/
|
|
325
327
|
interface FFIDOAuthUserInfo {
|
|
@@ -356,6 +358,19 @@ interface FFIDOAuthUserInfo {
|
|
|
356
358
|
* claim.
|
|
357
359
|
*/
|
|
358
360
|
organizationName?: string | null | undefined;
|
|
361
|
+
/**
|
|
362
|
+
* Organization membership role, `null` if FFID cannot resolve a role for the
|
|
363
|
+
* selected organization, or `undefined` if the granted scope omits
|
|
364
|
+
* `subscription:read` on `/oauth/userinfo` (FFID #4060), or if the caller
|
|
365
|
+
* used JWT verification without `includeProfile`. JWT payloads carry
|
|
366
|
+
* `org_id` but no membership-role claim.
|
|
367
|
+
*
|
|
368
|
+
* This duplicates `subscription.memberRole` at the top level so consumers can
|
|
369
|
+
* sync `(organizationId, organizationMemberRole)` without unpacking the full
|
|
370
|
+
* subscription blob. Older FFID responses that omit the top-level wire field
|
|
371
|
+
* are normalized from `subscription.member_role` when available.
|
|
372
|
+
*/
|
|
373
|
+
organizationMemberRole?: FFIDOAuthUserInfoMemberRole | null | undefined;
|
|
359
374
|
/**
|
|
360
375
|
* Subscription summary for `(user, service, organization)`. Branch on
|
|
361
376
|
* `effectiveStatus` (5.3.0+) for access decisions.
|
|
@@ -483,6 +498,14 @@ interface FFIDJwtClaims {
|
|
|
483
498
|
/** Service UUID */
|
|
484
499
|
svc_id: string;
|
|
485
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* OIDC `prompt` values the SDK forwards to FFID `/oauth/authorize` (#4027).
|
|
503
|
+
*
|
|
504
|
+
* - `select_account`: force the upstream IdP (Google) account chooser so RP-initiated
|
|
505
|
+
* account switching is not silently re-authenticated against the residual session.
|
|
506
|
+
* - `login`: force re-authentication (FFID `/login` is shown even with an active session).
|
|
507
|
+
*/
|
|
508
|
+
type FFIDPrompt = 'select_account' | 'login';
|
|
486
509
|
/**
|
|
487
510
|
* FFID context value provided to consumers
|
|
488
511
|
*/
|
|
@@ -508,9 +531,14 @@ interface FFIDContextValue {
|
|
|
508
531
|
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
509
532
|
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
510
533
|
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
534
|
+
* @param options.prompt OIDC `prompt` to forward to FFID `/oauth/authorize`
|
|
535
|
+
* (e.g. `'select_account'` to force the upstream account chooser). See
|
|
536
|
+
* {@link FFIDPrompt} (#4027). Prefer {@link FFIDContextValue} consumers use
|
|
537
|
+
* the dedicated `switchAccount()` helper on `useFFID()` for account switching.
|
|
511
538
|
*/
|
|
512
539
|
login: (options?: {
|
|
513
540
|
screenHint?: 'signup' | 'login';
|
|
541
|
+
prompt?: FFIDPrompt;
|
|
514
542
|
}) => void;
|
|
515
543
|
/** Sign out and clear session */
|
|
516
544
|
logout: () => Promise<void>;
|
|
@@ -1448,4 +1476,4 @@ interface FFIDInquiryFormPlaceholderContext {
|
|
|
1448
1476
|
}
|
|
1449
1477
|
declare function FFIDInquiryForm({ mode, prefill, organizations, preselectedOrganizationId, categories, termsVersion, privacyVersion, termsHref, privacyHref, turnstileToken, turnstileSlot, onSubmit, onChange, legalLayout, messagePlaceholder, requireCategorySelection, unstyled, classNames, locale, className, }: FFIDInquiryFormProps): react_jsx_runtime.JSX.Element;
|
|
1450
1478
|
|
|
1451
|
-
export {
|
|
1479
|
+
export { FFIDLoginButton as $, type AnnouncementListResponse as A, type AnnouncementStatus as B, type AnnouncementType as C, EFFECTIVE_SUBSCRIPTION_STATUSES as D, type EffectiveSubscriptionStatus as E, type FFIDSubscriptionStatus as F, FFIDAnnouncementBadge as G, FFIDAnnouncementList as H, type FFIDAnnouncementsError as I, type FFIDAnnouncementsErrorCode as J, type FFIDAnnouncementsServerResponse as K, type ListAnnouncementsOptions as L, type FFIDCacheConfig as M, type FFIDContextValue as N, type FFIDInquiryCategory as O, type FFIDInquiryCategorySite2026 as P, FFIDInquiryForm as Q, type FFIDInquiryFormCategoryItem as R, type FFIDInquiryFormClassNames as S, type FFIDInquiryFormLegalLayout as T, type FFIDInquiryFormOrganization as U, type FFIDInquiryFormPlaceholderContext as V, type FFIDInquiryFormPrefill as W, type FFIDInquiryFormProps as X, type FFIDInquiryFormSubmitData as Y, type FFIDInquiryFormSubmitResult as Z, type FFIDJwtClaims as _, type FFIDPrompt as a, type FFIDOAuthTokenResponse as a0, type FFIDOAuthUserInfoMemberRole as a1, FFIDOrganizationSwitcher as a2, type FFIDRedirectErrorCode as a3, type FFIDSeatModel as a4, type FFIDServiceAccessDenialReason as a5, type FFIDServiceAccessFailPolicy as a6, FFIDSubscriptionBadge as a7, type FFIDTokenIntrospectionResponse as a8, FFIDUserMenu as a9, FFID_INQUIRY_CATEGORIES as aa, FFID_INQUIRY_CATEGORIES_SITE_2026 as ab, type UseFFIDAnnouncementsOptions as ac, type UseFFIDAnnouncementsReturn as ad, isFFIDInquiryCategorySite2026 as ae, useFFIDAnnouncements as af, type FFIDAnnouncementBadgeClassNames as ag, type FFIDAnnouncementBadgeProps as ah, type FFIDAnnouncementListClassNames as ai, type FFIDAnnouncementListProps as aj, type FFIDLoginButtonProps as ak, type FFIDOrganizationSwitcherClassNames as al, type FFIDOrganizationSwitcherProps as am, type FFIDSubscriptionBadgeClassNames as an, type FFIDSubscriptionBadgeProps as ao, type FFIDUserMenuClassNames as ap, type FFIDUserMenuProps as aq, type FFIDConfig as b, type FFIDApiResponse as c, type FFIDSessionResponse as d, type FFIDRedirectResult as e, type FFIDError as f, type FFIDSubscriptionCheckResponse as g, type FFIDCheckServiceAccessParams as h, type FFIDServiceAccessDecision as i, type FFIDAnalyticsConfig as j, type FFIDVerifyAccessTokenOptions as k, type FFIDOAuthUserInfo as l, type FFIDInquiryCreateParams as m, type FFIDInquiryCreateResponse as n, type FFIDAuthMode as o, type FFIDLogger as p, type FFIDCacheAdapter as q, type FFIDUser as r, type FFIDOrganization as s, type FFIDSubscription as t, type FFIDSubscriptionContextValue as u, type FFIDOAuthUserInfoSubscription as v, type FFIDAnnouncementsClientConfig as w, type FFIDAnnouncementsApiResponse as x, type FFIDAnnouncementsLogger as y, type Announcement as z };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkA2KK6L63_cjs = require('./chunk-A2KK6L63.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 } = chunkA2KK6L63_cjs.useFFIDContext();
|
|
58
|
+
const { effectiveStatus, isBlocked, isGrace } = chunkA2KK6L63_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 } = chunkA2KK6L63_cjs.useFFIDContext();
|
|
80
80
|
const hasRedirected = react.useRef(false);
|
|
81
81
|
react.useEffect(() => {
|
|
82
82
|
if (!isLoading && !isAuthenticated && options.redirectToLogin && !hasRedirected.current) {
|
|
@@ -105,151 +105,151 @@ 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 chunkA2KK6L63_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 chunkA2KK6L63_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 chunkA2KK6L63_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 chunkA2KK6L63_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 chunkA2KK6L63_cjs.EFFECTIVE_SUBSCRIPTION_STATUSES; }
|
|
125
125
|
});
|
|
126
126
|
Object.defineProperty(exports, "FFIDAnnouncementBadge", {
|
|
127
127
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDAnnouncementBadge; }
|
|
129
129
|
});
|
|
130
130
|
Object.defineProperty(exports, "FFIDAnnouncementList", {
|
|
131
131
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDAnnouncementList; }
|
|
133
133
|
});
|
|
134
134
|
Object.defineProperty(exports, "FFIDInquiryForm", {
|
|
135
135
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDInquiryForm; }
|
|
137
137
|
});
|
|
138
138
|
Object.defineProperty(exports, "FFIDLoginButton", {
|
|
139
139
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDLoginButton; }
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "FFIDOrganizationSwitcher", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDOrganizationSwitcher; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "FFIDProvider", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDProvider; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "FFIDSDKError", {
|
|
151
151
|
enumerable: true,
|
|
152
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDSDKError; }
|
|
153
153
|
});
|
|
154
154
|
Object.defineProperty(exports, "FFIDSubscriptionBadge", {
|
|
155
155
|
enumerable: true,
|
|
156
|
-
get: function () { return
|
|
156
|
+
get: function () { return chunkA2KK6L63_cjs.FFIDSubscriptionBadge; }
|
|
157
157
|
});
|
|
158
158
|
Object.defineProperty(exports, "FFIDUserMenu", {
|
|
159
159
|
enumerable: true,
|
|
160
|
-
get: function () { return
|
|
160
|
+
get: function () { return chunkA2KK6L63_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 chunkA2KK6L63_cjs.FFID_ANNOUNCEMENTS_ERROR_CODES; }
|
|
165
165
|
});
|
|
166
166
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES", {
|
|
167
167
|
enumerable: true,
|
|
168
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkA2KK6L63_cjs.FFID_INQUIRY_CATEGORIES; }
|
|
169
169
|
});
|
|
170
170
|
Object.defineProperty(exports, "FFID_INQUIRY_CATEGORIES_SITE_2026", {
|
|
171
171
|
enumerable: true,
|
|
172
|
-
get: function () { return
|
|
172
|
+
get: function () { return chunkA2KK6L63_cjs.FFID_INQUIRY_CATEGORIES_SITE_2026; }
|
|
173
173
|
});
|
|
174
174
|
Object.defineProperty(exports, "clearState", {
|
|
175
175
|
enumerable: true,
|
|
176
|
-
get: function () { return
|
|
176
|
+
get: function () { return chunkA2KK6L63_cjs.cleanupStateStorage; }
|
|
177
177
|
});
|
|
178
178
|
Object.defineProperty(exports, "computeEffectiveStatusFromSession", {
|
|
179
179
|
enumerable: true,
|
|
180
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkA2KK6L63_cjs.computeEffectiveStatusFromSession; }
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "createFFIDAnnouncementsClient", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkA2KK6L63_cjs.createFFIDAnnouncementsClient; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "createFFIDClient", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkA2KK6L63_cjs.createFFIDClient; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "createTokenStore", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunkA2KK6L63_cjs.createTokenStore; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "generateCodeChallenge", {
|
|
195
195
|
enumerable: true,
|
|
196
|
-
get: function () { return
|
|
196
|
+
get: function () { return chunkA2KK6L63_cjs.generateCodeChallenge; }
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "generateCodeVerifier", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunkA2KK6L63_cjs.generateCodeVerifier; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "handleRedirectCallback", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunkA2KK6L63_cjs.handleRedirectCallback; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "hasAccessFromUserinfo", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunkA2KK6L63_cjs.hasAccessFromUserinfo; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "isBlockedFromUserinfo", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunkA2KK6L63_cjs.isBlockedFromUserinfo; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "isFFIDInquiryCategorySite2026", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunkA2KK6L63_cjs.isFFIDInquiryCategorySite2026; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "normalizeRedirectUri", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunkA2KK6L63_cjs.normalizeRedirectUri; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "retrieveCodeVerifier", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunkA2KK6L63_cjs.retrieveCodeVerifier; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "retrieveState", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunkA2KK6L63_cjs.retrieveState; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "storeCodeVerifier", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunkA2KK6L63_cjs.storeCodeVerifier; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "storeState", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunkA2KK6L63_cjs.storeState; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "useFFID", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunkA2KK6L63_cjs.useFFID; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "useFFIDAnnouncements", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunkA2KK6L63_cjs.useFFIDAnnouncements; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "useSubscription", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunkA2KK6L63_cjs.useSubscription; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "withSubscription", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunkA2KK6L63_cjs.withSubscription; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "ALL_DENIED_EXCEPT_NECESSARY", {
|
|
255
255
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-Bkul-fRw.cjs';
|
|
2
|
+
export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-Bkul-fRw.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';
|
|
@@ -1111,6 +1111,20 @@ interface RedirectToAuthorizeOptions {
|
|
|
1111
1111
|
* regardless of `authMode`.
|
|
1112
1112
|
*/
|
|
1113
1113
|
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1114
|
+
/**
|
|
1115
|
+
* OIDC `prompt` to forward to FFID `/oauth/authorize` (#4027).
|
|
1116
|
+
*
|
|
1117
|
+
* - `'select_account'`: forwards `prompt=select_account` so the upstream IdP
|
|
1118
|
+
* (Google) account chooser is shown — used by {@link switchAccount} to enable
|
|
1119
|
+
* RP-initiated account switching after logout (residual upstream sessions would
|
|
1120
|
+
* otherwise auto-re-authenticate the same account).
|
|
1121
|
+
* - `'login'`: forces re-authentication (FFID `/login` is shown even with an
|
|
1122
|
+
* active session).
|
|
1123
|
+
*
|
|
1124
|
+
* Token mode: added to the `/oauth/authorize` query. Cookie mode: forwarded as
|
|
1125
|
+
* `?prompt=…` on the `/login` URL (ignored for the signup screen).
|
|
1126
|
+
*/
|
|
1127
|
+
prompt?: FFIDPrompt;
|
|
1114
1128
|
}
|
|
1115
1129
|
|
|
1116
1130
|
/** Creates an FFID API client instance */
|
|
@@ -1120,7 +1134,12 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1120
1134
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1121
1135
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1122
1136
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1123
|
-
|
|
1137
|
+
switchAccount: (options?: {
|
|
1138
|
+
organizationId?: string;
|
|
1139
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1140
|
+
getLoginUrl: (redirectUrl?: string, options?: {
|
|
1141
|
+
prompt?: FFIDPrompt;
|
|
1142
|
+
}) => string;
|
|
1124
1143
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1125
1144
|
getSignupUrl: (redirectUrl?: string) => string;
|
|
1126
1145
|
createError: (code: string, message: string) => FFIDError;
|
|
@@ -1375,12 +1394,36 @@ interface UseFFIDReturn {
|
|
|
1375
1394
|
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
1376
1395
|
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
1377
1396
|
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
1397
|
+
* @param options.prompt OIDC `prompt` forwarded to FFID `/oauth/authorize`
|
|
1398
|
+
* (e.g. `'select_account'` to force the upstream account chooser). For account
|
|
1399
|
+
* switching, prefer the dedicated {@link UseFFIDReturn.switchAccount} helper (#4027).
|
|
1378
1400
|
*/
|
|
1379
1401
|
login: (options?: {
|
|
1380
1402
|
screenHint?: 'signup' | 'login';
|
|
1403
|
+
prompt?: FFIDPrompt;
|
|
1381
1404
|
}) => void;
|
|
1382
|
-
/** Sign out */
|
|
1405
|
+
/** Sign out (client-side: clears local session via the signout API) */
|
|
1383
1406
|
logout: () => Promise<void>;
|
|
1407
|
+
/**
|
|
1408
|
+
* Get the FFID SSO logout URL (RP-initiated logout). Includes `client_id` for
|
|
1409
|
+
* `post_logout_redirect_uri` validation. Use for cross-origin browser navigation
|
|
1410
|
+
* that must clear the SSO session cookie (#4027).
|
|
1411
|
+
*/
|
|
1412
|
+
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1413
|
+
/**
|
|
1414
|
+
* Redirect to the FFID SSO logout endpoint (clears the SSO session cookie via a
|
|
1415
|
+
* top-level browser navigation, so SameSite=Lax cookies are sent). #4027.
|
|
1416
|
+
*/
|
|
1417
|
+
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1418
|
+
/**
|
|
1419
|
+
* Switch / add account: forces the upstream Google account chooser via
|
|
1420
|
+
* `prompt=select_account` so RP-initiated account switching is not silently
|
|
1421
|
+
* re-authenticated against the residual upstream session. Pair with
|
|
1422
|
+
* {@link UseFFIDReturn.redirectToLogout} if an explicit signed-out step is needed (#4027).
|
|
1423
|
+
*/
|
|
1424
|
+
switchAccount: (options?: {
|
|
1425
|
+
organizationId?: string;
|
|
1426
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1384
1427
|
/**
|
|
1385
1428
|
* Switch current organization.
|
|
1386
1429
|
* Cookie mode: local state change. Token mode: OAuth re-authorization redirect.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDSubscriptionStatus, a as
|
|
2
|
-
export {
|
|
1
|
+
import { F as FFIDSubscriptionStatus, a as FFIDPrompt, b as FFIDConfig, c as FFIDApiResponse, d as FFIDSessionResponse, e as FFIDRedirectResult, f as FFIDError, g as FFIDSubscriptionCheckResponse, h as FFIDCheckServiceAccessParams, i as FFIDServiceAccessDecision, j as FFIDAnalyticsConfig, k as FFIDVerifyAccessTokenOptions, l as FFIDOAuthUserInfo, m as FFIDInquiryCreateParams, n as FFIDInquiryCreateResponse, o as FFIDAuthMode, p as FFIDLogger, q as FFIDCacheAdapter, r as FFIDUser, s as FFIDOrganization, t as FFIDSubscription, u as FFIDSubscriptionContextValue, E as EffectiveSubscriptionStatus, v as FFIDOAuthUserInfoSubscription, w as FFIDAnnouncementsClientConfig, L as ListAnnouncementsOptions, x as FFIDAnnouncementsApiResponse, A as AnnouncementListResponse, y as FFIDAnnouncementsLogger } from './index-Bkul-fRw.js';
|
|
2
|
+
export { z as Announcement, B as AnnouncementStatus, C as AnnouncementType, D as EFFECTIVE_SUBSCRIPTION_STATUSES, G as FFIDAnnouncementBadge, H as FFIDAnnouncementList, I as FFIDAnnouncementsError, J as FFIDAnnouncementsErrorCode, K as FFIDAnnouncementsServerResponse, M as FFIDCacheConfig, N as FFIDContextValue, O as FFIDInquiryCategory, P as FFIDInquiryCategorySite2026, Q as FFIDInquiryForm, R as FFIDInquiryFormCategoryItem, S as FFIDInquiryFormClassNames, T as FFIDInquiryFormLegalLayout, U as FFIDInquiryFormOrganization, V as FFIDInquiryFormPlaceholderContext, W as FFIDInquiryFormPrefill, X as FFIDInquiryFormProps, Y as FFIDInquiryFormSubmitData, Z as FFIDInquiryFormSubmitResult, _ as FFIDJwtClaims, $ as FFIDLoginButton, a0 as FFIDOAuthTokenResponse, a1 as FFIDOAuthUserInfoMemberRole, a2 as FFIDOrganizationSwitcher, a3 as FFIDRedirectErrorCode, a4 as FFIDSeatModel, a5 as FFIDServiceAccessDenialReason, a6 as FFIDServiceAccessFailPolicy, a7 as FFIDSubscriptionBadge, a8 as FFIDTokenIntrospectionResponse, a9 as FFIDUserMenu, aa as FFID_INQUIRY_CATEGORIES, ab as FFID_INQUIRY_CATEGORIES_SITE_2026, ac as UseFFIDAnnouncementsOptions, ad as UseFFIDAnnouncementsReturn, ae as isFFIDInquiryCategorySite2026, af as useFFIDAnnouncements } from './index-Bkul-fRw.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';
|
|
@@ -1111,6 +1111,20 @@ interface RedirectToAuthorizeOptions {
|
|
|
1111
1111
|
* regardless of `authMode`.
|
|
1112
1112
|
*/
|
|
1113
1113
|
screenHint?: typeof SCREEN_HINT_SIGNUP | 'login';
|
|
1114
|
+
/**
|
|
1115
|
+
* OIDC `prompt` to forward to FFID `/oauth/authorize` (#4027).
|
|
1116
|
+
*
|
|
1117
|
+
* - `'select_account'`: forwards `prompt=select_account` so the upstream IdP
|
|
1118
|
+
* (Google) account chooser is shown — used by {@link switchAccount} to enable
|
|
1119
|
+
* RP-initiated account switching after logout (residual upstream sessions would
|
|
1120
|
+
* otherwise auto-re-authenticate the same account).
|
|
1121
|
+
* - `'login'`: forces re-authentication (FFID `/login` is shown even with an
|
|
1122
|
+
* active session).
|
|
1123
|
+
*
|
|
1124
|
+
* Token mode: added to the `/oauth/authorize` query. Cookie mode: forwarded as
|
|
1125
|
+
* `?prompt=…` on the `/login` URL (ignored for the signup screen).
|
|
1126
|
+
*/
|
|
1127
|
+
prompt?: FFIDPrompt;
|
|
1114
1128
|
}
|
|
1115
1129
|
|
|
1116
1130
|
/** Creates an FFID API client instance */
|
|
@@ -1120,7 +1134,12 @@ declare function createFFIDClient(config: FFIDConfig): {
|
|
|
1120
1134
|
redirectToLogin: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1121
1135
|
redirectToAuthorize: (options?: RedirectToAuthorizeOptions) => Promise<FFIDRedirectResult>;
|
|
1122
1136
|
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1123
|
-
|
|
1137
|
+
switchAccount: (options?: {
|
|
1138
|
+
organizationId?: string;
|
|
1139
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1140
|
+
getLoginUrl: (redirectUrl?: string, options?: {
|
|
1141
|
+
prompt?: FFIDPrompt;
|
|
1142
|
+
}) => string;
|
|
1124
1143
|
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1125
1144
|
getSignupUrl: (redirectUrl?: string) => string;
|
|
1126
1145
|
createError: (code: string, message: string) => FFIDError;
|
|
@@ -1375,12 +1394,36 @@ interface UseFFIDReturn {
|
|
|
1375
1394
|
* (forwards `screen_hint=signup` in token mode / redirects to `/signup`
|
|
1376
1395
|
* in cookie mode). `'login'` and `undefined` use the default login flow.
|
|
1377
1396
|
* See `RedirectToAuthorizeOptions` (#2908 / #2911).
|
|
1397
|
+
* @param options.prompt OIDC `prompt` forwarded to FFID `/oauth/authorize`
|
|
1398
|
+
* (e.g. `'select_account'` to force the upstream account chooser). For account
|
|
1399
|
+
* switching, prefer the dedicated {@link UseFFIDReturn.switchAccount} helper (#4027).
|
|
1378
1400
|
*/
|
|
1379
1401
|
login: (options?: {
|
|
1380
1402
|
screenHint?: 'signup' | 'login';
|
|
1403
|
+
prompt?: FFIDPrompt;
|
|
1381
1404
|
}) => void;
|
|
1382
|
-
/** Sign out */
|
|
1405
|
+
/** Sign out (client-side: clears local session via the signout API) */
|
|
1383
1406
|
logout: () => Promise<void>;
|
|
1407
|
+
/**
|
|
1408
|
+
* Get the FFID SSO logout URL (RP-initiated logout). Includes `client_id` for
|
|
1409
|
+
* `post_logout_redirect_uri` validation. Use for cross-origin browser navigation
|
|
1410
|
+
* that must clear the SSO session cookie (#4027).
|
|
1411
|
+
*/
|
|
1412
|
+
getLogoutUrl: (postLogoutRedirectUri?: string) => string;
|
|
1413
|
+
/**
|
|
1414
|
+
* Redirect to the FFID SSO logout endpoint (clears the SSO session cookie via a
|
|
1415
|
+
* top-level browser navigation, so SameSite=Lax cookies are sent). #4027.
|
|
1416
|
+
*/
|
|
1417
|
+
redirectToLogout: (postLogoutRedirectUri?: string) => FFIDRedirectResult;
|
|
1418
|
+
/**
|
|
1419
|
+
* Switch / add account: forces the upstream Google account chooser via
|
|
1420
|
+
* `prompt=select_account` so RP-initiated account switching is not silently
|
|
1421
|
+
* re-authenticated against the residual upstream session. Pair with
|
|
1422
|
+
* {@link UseFFIDReturn.redirectToLogout} if an explicit signed-out step is needed (#4027).
|
|
1423
|
+
*/
|
|
1424
|
+
switchAccount: (options?: {
|
|
1425
|
+
organizationId?: string;
|
|
1426
|
+
}) => Promise<FFIDRedirectResult>;
|
|
1384
1427
|
/**
|
|
1385
1428
|
* Switch current organization.
|
|
1386
1429
|
* Cookie mode: local state change. Token mode: OAuth re-authorization redirect.
|
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_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-26X62P76.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_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-26X62P76.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
|
@@ -112,10 +112,13 @@ function hasOwnKey(value, key) {
|
|
|
112
112
|
function normalizeUserinfo(raw) {
|
|
113
113
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
114
114
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
115
|
+
const hasOrganizationMemberRole = hasOwnKey(raw, "organization_member_role");
|
|
116
|
+
const organizationMemberRole = hasOrganizationMemberRole ? raw.organization_member_role ?? null : raw.subscription ? raw.subscription.member_role ?? null : void 0;
|
|
117
|
+
const organizationFields = {
|
|
118
|
+
...hasOrganizationId ? { organizationId: raw.organization_id ?? null } : {},
|
|
119
|
+
...hasOrganizationId || hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {},
|
|
120
|
+
...organizationMemberRole !== void 0 ? { organizationMemberRole } : {}
|
|
121
|
+
};
|
|
119
122
|
return {
|
|
120
123
|
sub: raw.sub,
|
|
121
124
|
email: raw.email,
|
|
@@ -1090,7 +1093,7 @@ function createNonContractMethods(deps) {
|
|
|
1090
1093
|
}
|
|
1091
1094
|
|
|
1092
1095
|
// src/client/version-check.ts
|
|
1093
|
-
var SDK_VERSION = "5.
|
|
1096
|
+
var SDK_VERSION = "5.17.1";
|
|
1094
1097
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1095
1098
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1096
1099
|
function sdkHeaders() {
|
|
@@ -1841,6 +1844,9 @@ function createRedirectMethods(deps) {
|
|
|
1841
1844
|
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1842
1845
|
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1843
1846
|
}
|
|
1847
|
+
if (options?.prompt) {
|
|
1848
|
+
params.set("prompt", options.prompt);
|
|
1849
|
+
}
|
|
1844
1850
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1845
1851
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1846
1852
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1860,12 +1866,12 @@ function createRedirectMethods(deps) {
|
|
|
1860
1866
|
if (authMode === "token") {
|
|
1861
1867
|
return redirectToAuthorize(options);
|
|
1862
1868
|
}
|
|
1863
|
-
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1869
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl(void 0, options?.prompt ? { prompt: options.prompt } : void 0);
|
|
1864
1870
|
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1865
1871
|
window.location.href = targetUrl;
|
|
1866
1872
|
return { success: true };
|
|
1867
1873
|
}
|
|
1868
|
-
function getLoginUrl(redirectUrl) {
|
|
1874
|
+
function getLoginUrl(redirectUrl, options) {
|
|
1869
1875
|
let redirect;
|
|
1870
1876
|
if (redirectUrl != null) {
|
|
1871
1877
|
redirect = redirectUrl;
|
|
@@ -1875,7 +1881,8 @@ function createRedirectMethods(deps) {
|
|
|
1875
1881
|
logger.warn("getLoginUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
|
|
1876
1882
|
redirect = "";
|
|
1877
1883
|
}
|
|
1878
|
-
|
|
1884
|
+
const promptSuffix = options?.prompt ? `&prompt=${encodeURIComponent(options.prompt)}` : "";
|
|
1885
|
+
return `${baseUrl}/login?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}${promptSuffix}`;
|
|
1879
1886
|
}
|
|
1880
1887
|
function getSignupUrl(redirectUrl) {
|
|
1881
1888
|
let redirect;
|
|
@@ -1907,7 +1914,10 @@ function createRedirectMethods(deps) {
|
|
|
1907
1914
|
window.location.href = logoutUrl;
|
|
1908
1915
|
return { success: true };
|
|
1909
1916
|
}
|
|
1910
|
-
|
|
1917
|
+
async function switchAccount(options) {
|
|
1918
|
+
return redirectToLogin({ ...options, prompt: "select_account" });
|
|
1919
|
+
}
|
|
1920
|
+
return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount };
|
|
1911
1921
|
}
|
|
1912
1922
|
|
|
1913
1923
|
// src/client/redirect-uri.ts
|
|
@@ -2806,7 +2816,7 @@ function createFFIDClient(config) {
|
|
|
2806
2816
|
}
|
|
2807
2817
|
return signOutCookie();
|
|
2808
2818
|
}
|
|
2809
|
-
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout } = createRedirectMethods({
|
|
2819
|
+
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount } = createRedirectMethods({
|
|
2810
2820
|
authMode,
|
|
2811
2821
|
baseUrl,
|
|
2812
2822
|
clientId,
|
|
@@ -3000,6 +3010,7 @@ function createFFIDClient(config) {
|
|
|
3000
3010
|
redirectToLogin,
|
|
3001
3011
|
redirectToAuthorize,
|
|
3002
3012
|
redirectToLogout,
|
|
3013
|
+
switchAccount,
|
|
3003
3014
|
getLoginUrl,
|
|
3004
3015
|
getLogoutUrl,
|
|
3005
3016
|
getSignupUrl,
|
package/dist/server/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-
|
|
2
|
-
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-Cwk6cG3b.cjs';
|
|
2
|
+
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-Cwk6cG3b.cjs';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.cjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-BeVl-z12.cjs';
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-
|
|
2
|
-
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-
|
|
1
|
+
import { F as FFIDLogger, a as FFIDError, b as FFIDCacheAdapter, c as FFIDVerifyAccessTokenOptions, d as FFIDApiResponse, e as FFIDOAuthUserInfo } from '../ffid-client-w8Twi5lD.js';
|
|
2
|
+
export { f as FFIDAddMemberParams, g as FFIDAddMemberRequest, h as FFIDAddMemberResponse, i as FFIDAssignableMemberRole, j as FFIDCacheConfig, k as FFIDClient, l as FFIDConfig, m as FFIDListMembersResponse, n as FFIDMemberRole, o as FFIDOrganization, p as FFIDOrganizationMember, q as FFIDOtpSendResponse, r as FFIDOtpVerifyResponse, s as FFIDPasswordResetConfirmResponse, t as FFIDPasswordResetResponse, u as FFIDPasswordResetVerifyResponse, v as FFIDProfileCallOptions, w as FFIDRemoveMemberResponse, x as FFIDResetSessionResponse, y as FFIDSubscription, z as FFIDUpdateMemberRoleResponse, A as FFIDUpdateUserProfileRequest, B as FFIDUser, C as FFIDUserProfile, T as TokenData, D as TokenStore, E as createFFIDClient, G as createTokenStore } from '../ffid-client-w8Twi5lD.js';
|
|
3
3
|
export { D as DEFAULT_API_BASE_URL, a as DEFAULT_OAUTH_SCOPES } from '../constants-D61jqRIO.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import '../types-BeVl-z12.js';
|
package/dist/server/index.js
CHANGED
|
@@ -111,10 +111,13 @@ function hasOwnKey(value, key) {
|
|
|
111
111
|
function normalizeUserinfo(raw) {
|
|
112
112
|
const hasOrganizationId = hasOwnKey(raw, "organization_id");
|
|
113
113
|
const hasOrganizationName = hasOwnKey(raw, "organization_name");
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
const hasOrganizationMemberRole = hasOwnKey(raw, "organization_member_role");
|
|
115
|
+
const organizationMemberRole = hasOrganizationMemberRole ? raw.organization_member_role ?? null : raw.subscription ? raw.subscription.member_role ?? null : void 0;
|
|
116
|
+
const organizationFields = {
|
|
117
|
+
...hasOrganizationId ? { organizationId: raw.organization_id ?? null } : {},
|
|
118
|
+
...hasOrganizationId || hasOrganizationName ? { organizationName: raw.organization_name ?? null } : {},
|
|
119
|
+
...organizationMemberRole !== void 0 ? { organizationMemberRole } : {}
|
|
120
|
+
};
|
|
118
121
|
return {
|
|
119
122
|
sub: raw.sub,
|
|
120
123
|
email: raw.email,
|
|
@@ -1089,7 +1092,7 @@ function createNonContractMethods(deps) {
|
|
|
1089
1092
|
}
|
|
1090
1093
|
|
|
1091
1094
|
// src/client/version-check.ts
|
|
1092
|
-
var SDK_VERSION = "5.
|
|
1095
|
+
var SDK_VERSION = "5.17.1";
|
|
1093
1096
|
var SDK_USER_AGENT = `FFID-SDK/${SDK_VERSION} (TypeScript)`;
|
|
1094
1097
|
var SDK_VERSION_HEADER = "X-FFID-SDK-Version";
|
|
1095
1098
|
function sdkHeaders() {
|
|
@@ -1840,6 +1843,9 @@ function createRedirectMethods(deps) {
|
|
|
1840
1843
|
if (options?.screenHint === SCREEN_HINT_SIGNUP) {
|
|
1841
1844
|
params.set(SCREEN_HINT_PARAM, SCREEN_HINT_SIGNUP);
|
|
1842
1845
|
}
|
|
1846
|
+
if (options?.prompt) {
|
|
1847
|
+
params.set("prompt", options.prompt);
|
|
1848
|
+
}
|
|
1843
1849
|
const authorizeUrl = `${baseUrl}${OAUTH_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
1844
1850
|
logger.debug("Redirecting to authorize:", authorizeUrl);
|
|
1845
1851
|
recordRedirectAttempt(authorizeKey, now, logger);
|
|
@@ -1859,12 +1865,12 @@ function createRedirectMethods(deps) {
|
|
|
1859
1865
|
if (authMode === "token") {
|
|
1860
1866
|
return redirectToAuthorize(options);
|
|
1861
1867
|
}
|
|
1862
|
-
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl();
|
|
1868
|
+
const targetUrl = options?.screenHint === SCREEN_HINT_SIGNUP ? getSignupUrl() : getLoginUrl(void 0, options?.prompt ? { prompt: options.prompt } : void 0);
|
|
1863
1869
|
logger.debug("Redirecting to auth page:", targetUrl);
|
|
1864
1870
|
window.location.href = targetUrl;
|
|
1865
1871
|
return { success: true };
|
|
1866
1872
|
}
|
|
1867
|
-
function getLoginUrl(redirectUrl) {
|
|
1873
|
+
function getLoginUrl(redirectUrl, options) {
|
|
1868
1874
|
let redirect;
|
|
1869
1875
|
if (redirectUrl != null) {
|
|
1870
1876
|
redirect = redirectUrl;
|
|
@@ -1874,7 +1880,8 @@ function createRedirectMethods(deps) {
|
|
|
1874
1880
|
logger.warn("getLoginUrl: SSR \u74B0\u5883\u3067 redirectUrl \u304C\u672A\u6307\u5B9A\u306E\u305F\u3081\u7A7A\u6587\u5B57\u306B\u30D5\u30A9\u30FC\u30EB\u30D0\u30C3\u30AF\u3057\u307E\u3059");
|
|
1875
1881
|
redirect = "";
|
|
1876
1882
|
}
|
|
1877
|
-
|
|
1883
|
+
const promptSuffix = options?.prompt ? `&prompt=${encodeURIComponent(options.prompt)}` : "";
|
|
1884
|
+
return `${baseUrl}/login?redirect=${encodeURIComponent(redirect)}&service=${encodeURIComponent(serviceCode)}${promptSuffix}`;
|
|
1878
1885
|
}
|
|
1879
1886
|
function getSignupUrl(redirectUrl) {
|
|
1880
1887
|
let redirect;
|
|
@@ -1906,7 +1913,10 @@ function createRedirectMethods(deps) {
|
|
|
1906
1913
|
window.location.href = logoutUrl;
|
|
1907
1914
|
return { success: true };
|
|
1908
1915
|
}
|
|
1909
|
-
|
|
1916
|
+
async function switchAccount(options) {
|
|
1917
|
+
return redirectToLogin({ ...options, prompt: "select_account" });
|
|
1918
|
+
}
|
|
1919
|
+
return { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount };
|
|
1910
1920
|
}
|
|
1911
1921
|
|
|
1912
1922
|
// src/client/redirect-uri.ts
|
|
@@ -2805,7 +2815,7 @@ function createFFIDClient(config) {
|
|
|
2805
2815
|
}
|
|
2806
2816
|
return signOutCookie();
|
|
2807
2817
|
}
|
|
2808
|
-
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout } = createRedirectMethods({
|
|
2818
|
+
const { redirectToLogin, redirectToAuthorize, getLoginUrl, getSignupUrl, getLogoutUrl, redirectToLogout, switchAccount } = createRedirectMethods({
|
|
2809
2819
|
authMode,
|
|
2810
2820
|
baseUrl,
|
|
2811
2821
|
clientId,
|
|
@@ -2999,6 +3009,7 @@ function createFFIDClient(config) {
|
|
|
2999
3009
|
redirectToLogin,
|
|
3000
3010
|
redirectToAuthorize,
|
|
3001
3011
|
redirectToLogout,
|
|
3012
|
+
switchAccount,
|
|
3002
3013
|
getLoginUrl,
|
|
3003
3014
|
getLogoutUrl,
|
|
3004
3015
|
getSignupUrl,
|