@dloizides/auth-web 1.9.1 → 1.10.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/CHANGELOG.md +53 -0
- package/dist/index.d.mts +92 -1
- package/dist/index.d.ts +92 -1
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3285,6 +3285,43 @@ function resolveAccessibleRoutes(user, table) {
|
|
|
3285
3285
|
return table.routes.filter((entry) => userRoles.has(entry.role));
|
|
3286
3286
|
}
|
|
3287
3287
|
|
|
3288
|
-
|
|
3288
|
+
// src/session/performBffLogout.ts
|
|
3289
|
+
function toError4(caught) {
|
|
3290
|
+
return caught instanceof Error ? caught : new Error(String(caught));
|
|
3291
|
+
}
|
|
3292
|
+
function runGuarded(callback, onError) {
|
|
3293
|
+
if (callback === void 0) {
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
try {
|
|
3297
|
+
callback();
|
|
3298
|
+
} catch (caught) {
|
|
3299
|
+
onError?.(toError4(caught));
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
function assignLocation(url) {
|
|
3303
|
+
if (typeof window === "undefined") {
|
|
3304
|
+
return;
|
|
3305
|
+
}
|
|
3306
|
+
window.location.assign(url);
|
|
3307
|
+
}
|
|
3308
|
+
async function performBffLogout(options) {
|
|
3309
|
+
const { client, onClearSession, onRedirect, onError, navigateToIdp = assignLocation } = options;
|
|
3310
|
+
runGuarded(onClearSession, onError);
|
|
3311
|
+
let idpLogoutUrl = null;
|
|
3312
|
+
try {
|
|
3313
|
+
idpLogoutUrl = await client.logout({ redirect: false });
|
|
3314
|
+
} catch (caught) {
|
|
3315
|
+
onError?.(toError4(caught));
|
|
3316
|
+
}
|
|
3317
|
+
if (idpLogoutUrl !== null) {
|
|
3318
|
+
const url = idpLogoutUrl;
|
|
3319
|
+
runGuarded(() => navigateToIdp(url), onError);
|
|
3320
|
+
return;
|
|
3321
|
+
}
|
|
3322
|
+
runGuarded(onRedirect, onError);
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
export { AuthScreen, AuthTestIds, AuthThemeProvider, BffAuthStatus, DEFAULT_AUTH_CARD_MAX_WIDTH, DEFAULT_DEVICE_PIN_ENROLL_LABELS, DEFAULT_DEVICE_PIN_SETTINGS_LABELS, DEFAULT_DEVICE_PIN_UNLOCK_LABELS, DEFAULT_FORGOT_PASSWORD_FIELDS_LABELS, DEFAULT_FORGOT_PASSWORD_LABELS, DEFAULT_LOGIN_LABELS, DEFAULT_OTP_LABELS, DEFAULT_PASSKEY_LOGIN_LABELS, DEFAULT_PASSKEY_SETTINGS_LABELS, DEFAULT_PIN_LABELS, DEFAULT_PREFERRED_METHOD_HINT_LABELS, DEFAULT_PREFERRED_METHOD_SETTINGS_LABELS, DEFAULT_RESET_PASSWORD_LABELS, DEVICE_PIN_ALLOWED_DIGITS, DEVICE_PIN_DEFAULT_DIGITS, DevicePinEnrollErrorKey, DevicePinEnrollForm, DevicePinErrorKey, DevicePinInput, DevicePinLengthPicker, DevicePinOffer, DevicePinSettingsCard, DevicePinUnlockScreen, ForgotPasswordFields, ForgotPasswordForm, LoginForm, OtpForm, OtpLoginStep, PASSWORD_MAX_LENGTH, PASSWORD_MIN_LENGTH, PasskeyCeremonyMode, PasskeyCeremonyStatus, PasskeyLoginButton, PasskeySettingsCard, PasswordPolicyError, PinForm, PreferredMethodHint, PreferredMethodSettingsCard, ResetPasswordError, ResetPasswordForm, cachePreferredMethod, clearCachedPreferredMethod, collectUserRoles, createBffAuthClient, createPreferencesClient, defaultAuthTheme, isAllowedPinDigits, isPasswordValid, isValidForgotPasswordEmail, performBffLogout, readCachedPreferredMethod, readPasskeyError, readPasskeyRegistered, resolveAccessibleRoutes, resolvePostLoginRoute, startPasskeyLogin, startPasskeyRegistration, syncPreferredMethodFromServer, useAuthTheme, useBffAuth, useBffForgotPassword, useBffLoginConfig, useBffResetPassword, useDevicePinDisable, useDevicePinEnroll, useDevicePinUnlock, useForgotPasswordSubmit, useOtpLogin, usePasskeyCeremony, usePinLogin, usePreferredMethodSetting, useResetPasswordForm, validatePasswordPolicy, withTestIdPrefix };
|
|
3289
3326
|
//# sourceMappingURL=index.mjs.map
|
|
3290
3327
|
//# sourceMappingURL=index.mjs.map
|