@rebasepro/client-firebase 0.2.1 → 0.2.4

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.
@@ -16,4 +16,4 @@ import { RebaseFirebaseAppProps } from "./RebaseFirebaseAppProps";
16
16
 
17
17
  * @category Firebase
18
18
  */
19
- export declare function RebaseFirebaseApp({ name, logo, logoDark, authenticator, collections, views, adminViews, textSearchControllerBuilder, allowSkipLogin, signInOptions, firebaseConfig, onFirebaseInit, appCheckOptions, dateTimeFormat, locale, basePath, baseCollectionPath, onAnalyticsEvent, propertyConfigs: propertyConfigsProp, plugins, autoOpenDrawer, firestoreIndexesBuilder, components, localTextSearchEnabled, userManagement }: RebaseFirebaseAppProps): import("react/jsx-runtime").JSX.Element;
19
+ export declare function RebaseFirebaseApp({ name, logo, logoDark, accessGate, collections, views, adminViews, textSearchControllerBuilder, allowSkipLogin, signInOptions, firebaseConfig, onFirebaseInit, appCheckOptions, dateTimeFormat, locale, basePath, baseCollectionPath, onAnalyticsEvent, propertyConfigs: propertyConfigsProp, plugins, autoOpenDrawer, firestoreIndexesBuilder, components, localTextSearchEnabled, userManagement }: RebaseFirebaseAppProps): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
- import { Authenticator, AnalyticsEvent, AppView, AppViewsBuilder, EntityCollection, EntityCollectionsBuilder, RebasePlugin, Locale, PropertyConfig } from "@rebasepro/types";
2
+ import { AnalyticsEvent, AppView, AppViewsBuilder, EntityCollection, EntityCollectionsBuilder, RebasePlugin, Locale, PropertyConfig } from "@rebasepro/types";
3
+ import { FirebaseAccessGate } from "../hooks/useFirebaseAccessGate";
3
4
  import { UserManagementDelegate } from "@rebasepro/types";
4
5
  import { FirebaseApp } from "@firebase/app";
5
6
  import { FirebaseLoginViewProps } from "./FirebaseLoginView";
@@ -48,12 +49,12 @@ export type RebaseFirebaseAppProps = {
48
49
  propertyConfigs?: PropertyConfig[];
49
50
  /**
50
51
  * Do the users need to log in to access the CMS.
51
- * You can specify an Authenticator function to discriminate which users can
52
- * access the CMS or not.
52
+ * You can specify a {@link FirebaseAccessGate} function to discriminate
53
+ * which users can access the CMS or not.
53
54
  * If not specified, authentication is enabled but no user restrictions
54
55
  * apply
55
56
  */
56
- authenticator?: boolean | Authenticator<FirebaseUserWrapper>;
57
+ accessGate?: boolean | FirebaseAccessGate<FirebaseUserWrapper>;
57
58
  /**
58
59
  * List of sign in options that will be displayed in the login
59
60
  * view if `authentication` is enabled. You can pass Firebase providers strings,
@@ -6,3 +6,4 @@ export * from "./useFirestoreDriver";
6
6
  export * from "./useFirebaseRealTimeDBDelegate";
7
7
  export * from "./useRecaptcha";
8
8
  export * from "./useBuildUserManagement";
9
+ export * from "./useFirebaseAccessGate";
@@ -10,7 +10,7 @@ export interface InitializeAppCheckProps {
10
10
  export interface InitializeAppCheckResult {
11
11
  loading: boolean;
12
12
  appCheckVerified?: boolean;
13
- error?: any;
13
+ error?: unknown;
14
14
  }
15
15
  /**
16
16
  * Function used to initialise Firebase App Check.
@@ -1,5 +1,5 @@
1
1
  import { AuthController, DataDriver, Role, User, UserManagementDelegate } from "@rebasepro/types";
2
- export interface UserManagementDelegateParams<CONTROLLER extends AuthController<any> = AuthController<any>> {
2
+ export interface UserManagementDelegateParams<CONTROLLER extends AuthController<User> = AuthController<User>> {
3
3
  authController: CONTROLLER;
4
4
  /**
5
5
  * The delegate in charge of persisting the data.
@@ -27,10 +27,6 @@ export interface UserManagementDelegateParams<CONTROLLER extends AuthController<
27
27
  * If there are no roles in the database, provide a button to create the default roles.
28
28
  */
29
29
  allowDefaultRolesCreation?: boolean;
30
- /**
31
- * Include the collection config permissions in the user management system.
32
- */
33
- includeCollectionConfigPermissions?: boolean;
34
30
  }
35
31
  /**
36
32
  * This hook is used to build a user management object that can be used to
@@ -41,6 +37,5 @@ export interface UserManagementDelegateParams<CONTROLLER extends AuthController<
41
37
  * @param rolesPath
42
38
  * @param roles
43
39
  * @param allowDefaultRolesCreation
44
- * @param includeCollectionConfigPermissions
45
40
  */
46
- export declare function useBuildUserManagement<CONTROLLER extends AuthController<any> = AuthController<any>, USER extends User = CONTROLLER extends AuthController<infer U> ? U : any>({ authController, dataSourceDelegate, roles: rolesProp, usersPath, rolesPath, allowDefaultRolesCreation, includeCollectionConfigPermissions }: UserManagementDelegateParams<CONTROLLER>): UserManagementDelegate<USER> & CONTROLLER;
41
+ export declare function useBuildUserManagement<CONTROLLER extends AuthController<User> = AuthController<User>, USER extends User = CONTROLLER extends AuthController<infer U> ? U : User>({ authController, dataSourceDelegate, roles: rolesProp, usersPath, rolesPath, allowDefaultRolesCreation }: UserManagementDelegateParams<CONTROLLER>): UserManagementDelegate<USER> & CONTROLLER;
@@ -0,0 +1,44 @@
1
+ import { AuthController, RebaseData, StorageSource, User } from "@rebasepro/types";
2
+ /**
3
+ * Client-side gate that decides whether a Firebase-authenticated user
4
+ * is allowed to access the CMS UI.
5
+ *
6
+ * Return `true` to allow access or `false` / throw to deny.
7
+ * @group Firebase
8
+ */
9
+ export type FirebaseAccessGate<USER extends User = User> = (props: {
10
+ /**
11
+ * Logged-in user or null
12
+ */
13
+ user: USER | null;
14
+ /**
15
+ * AuthController
16
+ */
17
+ authController: AuthController<USER>;
18
+ /**
19
+ * Unified data access API
20
+ */
21
+ data: RebaseData;
22
+ /**
23
+ * Used storage implementation
24
+ */
25
+ storageSource: StorageSource;
26
+ }) => boolean | Promise<boolean>;
27
+ /**
28
+ * Hook that evaluates a {@link FirebaseAccessGate} callback after
29
+ * the user logs in and gates access to the main CMS view.
30
+ *
31
+ * @group Firebase
32
+ */
33
+ export declare function useFirebaseAccessGate<USER extends User = User>({ disabled, authController, accessGate, storageSource, data }: {
34
+ disabled?: boolean;
35
+ authController: AuthController<USER>;
36
+ accessGate?: boolean | FirebaseAccessGate<USER>;
37
+ data: RebaseData;
38
+ storageSource: StorageSource;
39
+ }): {
40
+ canAccessMainView: boolean;
41
+ authLoading: boolean;
42
+ notAllowedError: unknown;
43
+ authVerified: boolean;
44
+ };
@@ -52,5 +52,5 @@ export declare function useFirestoreDriver({ firebaseApp, textSearchControllerBu
52
52
  * @param data
53
53
  * @group Firestore
54
54
  */
55
- export declare function firestoreToCMSModel(data: any): any;
56
- export declare function cmsToFirestoreModel(data: any, firestore: Firestore, inArray?: boolean): any;
55
+ export declare function firestoreToCMSModel(data: unknown): unknown;
56
+ export declare function cmsToFirestoreModel(data: unknown, firestore: Firestore, inArray?: boolean): unknown;
package/dist/index.es.js CHANGED
@@ -13,7 +13,7 @@ import { c } from "react-compiler-runtime";
13
13
  import { getDatabase, query as query$1, ref as ref$1, orderByKey, startAt, limitToFirst, get, onValue, push, set, remove, orderByChild } from "@firebase/database";
14
14
  import { removeUndefined } from "@rebasepro/utils";
15
15
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
16
- import { useModeController, ErrorView, useSnackbarController, RebaseLogo, useBrowserTitleAndIcon, useBuildModeController, useBuildAdminModeController, useBuildLocalConfigurationPersistence, useValidateAuthenticator, RebaseRoutes, Rebase, AdminModeControllerProvider, SnackbarProvider, ModeControllerProvider } from "@rebasepro/core";
16
+ import { useModeController, ErrorView, useSnackbarController, RebaseLogo, useBrowserTitleAndIcon, useBuildModeController, useBuildAdminModeController, useBuildLocalConfigurationPersistence, RebaseRoutes, Rebase, AdminModeControllerProvider, SnackbarProvider, ModeControllerProvider } from "@rebasepro/core";
17
17
  import { useBuildCollectionRegistryController, useBuildUrlController, useBuildNavigationStateController, NavigationStateContext, UrlContext, CollectionRegistryContext, SideEntityProvider, RebaseRoute, Scaffold, AppBar, Drawer, SideDialogs } from "@rebasepro/admin";
18
18
  import { MailIcon, iconSize, PhoneIcon, UserIcon, Button, cls, IconButton, ArrowLeftIcon, Typography, TextField, CircularProgress, LoadingButton, CircularProgressCenter, CenteredView } from "@rebasepro/ui";
19
19
  import { Navigate, Route, Outlet } from "react-router-dom";
@@ -351,7 +351,7 @@ function useFirebaseStorageSource({
351
351
  const blob = await response.blob();
352
352
  return new File([blob], path);
353
353
  } catch (e) {
354
- if (e?.code === "storage/object-not-found") return null;
354
+ if (typeof e === "object" && e !== null && "code" in e && e.code === "storage/object-not-found") return null;
355
355
  throw e;
356
356
  }
357
357
  },
@@ -383,7 +383,7 @@ function useFirebaseStorageSource({
383
383
  urlsCache[storagePathOrUrl] = result;
384
384
  return result;
385
385
  } catch (e) {
386
- if (e?.code === "storage/object-not-found") return {
386
+ if (typeof e === "object" && e !== null && "code" in e && e.code === "storage/object-not-found") return {
387
387
  url: null,
388
388
  fileNotFound: true
389
389
  };
@@ -442,7 +442,7 @@ function useInitialiseFirebase({
442
442
  setFirebaseApp(initialisedFirebaseApp);
443
443
  } catch (e) {
444
444
  console.error("Error initialising Firebase", e);
445
- setConfigError(hostingError + "\n" + (e.message ?? JSON.stringify(e)));
445
+ setConfigError(hostingError + "\n" + (e instanceof Error ? e.message : JSON.stringify(e)));
446
446
  }
447
447
  }, [name]);
448
448
  useEffect(() => {
@@ -511,7 +511,7 @@ function useAppCheck({
511
511
  }
512
512
  } catch (e) {
513
513
  console.error("App Check error:", e);
514
- setError(e.message);
514
+ setError(e instanceof Error ? e.message : String(e));
515
515
  }
516
516
  }, [options?.forceRefresh]);
517
517
  useEffect(() => {
@@ -867,7 +867,7 @@ function buildRebaseSearchController(options) {
867
867
  }
868
868
  } catch (error) {
869
869
  console.error("Failed to get search config from extension:", error);
870
- throw new Error(`Failed to initialize Rebase Search. Make sure the rebase-search extension is installed and configured. Error: ${error.message || error}`);
870
+ throw new Error(`Failed to initialize Rebase Search. Make sure the rebase-search extension is installed and configured. Error: ${error instanceof Error ? error.message : String(error)}`);
871
871
  }
872
872
  }
873
873
  if (!searchConfig) {
@@ -948,7 +948,7 @@ function buildRebaseSearchController(options) {
948
948
  schemaCache.set(collectionName, stringFields);
949
949
  return stringFields;
950
950
  } catch (error) {
951
- if (error.httpStatus === 404) {
951
+ if (error instanceof Error && "httpStatus" in error && error.httpStatus === 404) {
952
952
  throw new Error(`Collection "${collectionName}" not found in Typesense. Make sure the collection has been indexed. Try running the backfill function.`);
953
953
  }
954
954
  throw error;
@@ -988,7 +988,7 @@ function buildRebaseSearchController(options) {
988
988
  const ids = result.hits?.map((hit) => hit.document.id) ?? [];
989
989
  return ids;
990
990
  } catch (error) {
991
- const message = error.message || error.toString();
991
+ const message = error instanceof Error ? error.message : String(error);
992
992
  throw new Error(`Search failed: ${message}`);
993
993
  }
994
994
  };
@@ -1413,13 +1413,13 @@ const createEntityFromDocument = (docSnap, databaseId) => {
1413
1413
  };
1414
1414
  function firestoreToCMSModel(data) {
1415
1415
  if (data === null || data === void 0) return null;
1416
- if (deleteField().isEqual(data)) {
1416
+ if (typeof data === "object" && data !== null && "isEqual" in data && typeof data.isEqual === "function" && deleteField().isEqual(data)) {
1417
1417
  return void 0;
1418
1418
  }
1419
- if (serverTimestamp().isEqual(data)) {
1419
+ if (typeof data === "object" && data !== null && "isEqual" in data && typeof data.isEqual === "function" && serverTimestamp().isEqual(data)) {
1420
1420
  return null;
1421
1421
  }
1422
- if (data instanceof Timestamp || typeof data.toDate === "function" && data.toDate() instanceof Date) {
1422
+ if (data instanceof Timestamp || typeof data === "object" && data !== null && "toDate" in data && typeof data.toDate === "function" && data.toDate() instanceof Date) {
1423
1423
  return data.toDate();
1424
1424
  }
1425
1425
  if (data instanceof Date) {
@@ -1428,7 +1428,7 @@ function firestoreToCMSModel(data) {
1428
1428
  if (typeof data === "object" && "__type__" in data && data.__type__ === "__vector__") {
1429
1429
  return data;
1430
1430
  }
1431
- if (data instanceof VectorValue || typeof data === "object" && data !== null && typeof data.toArray === "function" && data.constructor?.name === "VectorValue") {
1431
+ if (data instanceof VectorValue || typeof data === "object" && data !== null && "toArray" in data && typeof data.toArray === "function" && data.constructor?.name === "VectorValue") {
1432
1432
  return {
1433
1433
  __type__: "__vector__",
1434
1434
  value: data.toArray()
@@ -1470,11 +1470,13 @@ function cmsToFirestoreModel(data, firestore, inArray = false) {
1470
1470
  return null;
1471
1471
  } else if (Array.isArray(data)) {
1472
1472
  return data.filter((v) => v !== void 0).map((v) => cmsToFirestoreModel(v, firestore, true));
1473
- } else if (data.isEntityReference && data.isEntityReference()) {
1474
- const targetFirestore = data.databaseId ? getFirestore(firestore.app, data.databaseId) : firestore;
1475
- return doc(targetFirestore, data.path, data.id);
1476
- } else if (data && typeof data === "object" && data.__type === "relation" && data.path && data.id) {
1477
- return doc(firestore, data.path, String(data.id));
1473
+ } else if (typeof data === "object" && data !== null && "isEntityReference" in data && typeof data.isEntityReference === "function" && data.isEntityReference()) {
1474
+ const entityRef = data;
1475
+ const targetFirestore = entityRef.databaseId ? getFirestore(firestore.app, entityRef.databaseId) : firestore;
1476
+ return doc(targetFirestore, entityRef.path, entityRef.id);
1477
+ } else if (data && typeof data === "object" && "__type" in data && data.__type === "relation" && "path" in data && "id" in data) {
1478
+ const rel = data;
1479
+ return doc(firestore, rel.path, String(rel.id));
1478
1480
  } else if (data instanceof GeoPoint) {
1479
1481
  return new GeoPoint$1(data.latitude, data.longitude);
1480
1482
  } else if (data instanceof Date) {
@@ -1805,8 +1807,9 @@ function cmsToRTDBModel(data, database) {
1805
1807
  return null;
1806
1808
  } else if (Array.isArray(data)) {
1807
1809
  return data.filter((v) => v !== void 0).map((v) => cmsToRTDBModel(v, database));
1808
- } else if (data.isEntityReference && data.isEntityReference()) {
1809
- return ref$1(database, `${data.slug}/${data.id}`);
1810
+ } else if (typeof data === "object" && data !== null && "isEntityReference" in data && typeof data.isEntityReference === "function" && data.isEntityReference()) {
1811
+ const entityRef = data;
1812
+ return ref$1(database, `${entityRef.slug}/${entityRef.id}`);
1810
1813
  } else if (data instanceof Date) {
1811
1814
  return data.toISOString();
1812
1815
  } else if (data && typeof data === "object") {
@@ -1851,8 +1854,7 @@ function useBuildUserManagement({
1851
1854
  roles: rolesProp,
1852
1855
  usersPath = "__FIRECMS/config/users",
1853
1856
  rolesPath = "__FIRECMS/config/roles",
1854
- allowDefaultRolesCreation,
1855
- includeCollectionConfigPermissions
1857
+ allowDefaultRolesCreation
1856
1858
  }) {
1857
1859
  if (!authController) {
1858
1860
  throw Error("useBuildUserManagement: You need to provide an authController since version 3.0.0-beta.11. Check https://firecms.co/docs/pro/migrating_from_v3_beta");
@@ -1896,7 +1898,7 @@ function useBuildUserManagement({
1896
1898
  onError(e_0) {
1897
1899
  setRoles([]);
1898
1900
  console.error("Error loading roles", e_0);
1899
- setRolesError(e_0);
1901
+ setRolesError(e_0 instanceof Error ? e_0 : new Error(String(e_0)));
1900
1902
  setRolesLoading(false);
1901
1903
  }
1902
1904
  });
@@ -1928,7 +1930,7 @@ function useBuildUserManagement({
1928
1930
  onError(e_2) {
1929
1931
  console.error("Error loading users", e_2);
1930
1932
  setUsersWithRoleIds([]);
1931
- setUsersError(e_2);
1933
+ setUsersError(e_2 instanceof Error ? e_2 : new Error(String(e_2)));
1932
1934
  setUsersLoading(false);
1933
1935
  }
1934
1936
  });
@@ -2024,7 +2026,7 @@ function useBuildUserManagement({
2024
2026
  if (!mgmtUser || !mgmtUser.roles) return void 0;
2025
2027
  return roles.filter((r) => mgmtUser.roles.includes(r.id));
2026
2028
  }, [roles, usersWithRoleIds]);
2027
- const authenticator = useCallback(({
2029
+ const accessGate = useCallback(({
2028
2030
  user: user_2
2029
2031
  }) => {
2030
2032
  if (loading) {
@@ -2089,9 +2091,8 @@ function useBuildUserManagement({
2089
2091
  usersError,
2090
2092
  isAdmin,
2091
2093
  allowDefaultRolesCreation: allowDefaultRolesCreation === void 0 ? true : allowDefaultRolesCreation,
2092
- includeCollectionConfigPermissions: Boolean(includeCollectionConfigPermissions),
2093
2094
  defineRolesFor,
2094
- authenticator,
2095
+ accessGate,
2095
2096
  ...authController,
2096
2097
  initialLoading: authController.initialLoading || loading,
2097
2098
  userRoles,
@@ -2107,8 +2108,8 @@ const entitiesToUsers = (docs) => {
2107
2108
  const data = doc2.values;
2108
2109
  const record = data;
2109
2110
  const newVar = {
2110
- uid: doc2.id,
2111
2111
  ...data,
2112
+ uid: doc2.id,
2112
2113
  created_on: record.created_on,
2113
2114
  updated_on: record.updated_on
2114
2115
  };
@@ -2121,6 +2122,128 @@ const entityToRoles = (entities) => {
2121
2122
  ...doc2.values
2122
2123
  }));
2123
2124
  };
2125
+ function useFirebaseAccessGate(t0) {
2126
+ const $ = c(17);
2127
+ const {
2128
+ disabled,
2129
+ authController,
2130
+ accessGate,
2131
+ storageSource,
2132
+ data
2133
+ } = t0;
2134
+ const gateEnabled = Boolean(accessGate);
2135
+ const [authLoading, setAuthLoading] = useState(gateEnabled);
2136
+ const [notAllowedError, setNotAllowedError] = useState(false);
2137
+ const [authVerified, setAuthVerified] = useState(!gateEnabled || Boolean(authController.loginSkipped));
2138
+ const canAccessMainView = authVerified && (!gateEnabled || Boolean(authController.user) || Boolean(authController.loginSkipped)) && !notAllowedError;
2139
+ let t1;
2140
+ let t2;
2141
+ if ($[0] !== authController.loginSkipped) {
2142
+ t1 = () => {
2143
+ if (authController.loginSkipped) {
2144
+ setAuthVerified(true);
2145
+ }
2146
+ };
2147
+ t2 = [authController.loginSkipped];
2148
+ $[0] = authController.loginSkipped;
2149
+ $[1] = t1;
2150
+ $[2] = t2;
2151
+ } else {
2152
+ t1 = $[1];
2153
+ t2 = $[2];
2154
+ }
2155
+ useEffect(t1, t2);
2156
+ const checkedUserRef = useRef(void 0);
2157
+ let t3;
2158
+ if ($[3] !== accessGate || $[4] !== authController || $[5] !== data || $[6] !== disabled || $[7] !== storageSource) {
2159
+ t3 = async () => {
2160
+ if (disabled) {
2161
+ return;
2162
+ }
2163
+ if (authController.initialLoading) {
2164
+ return;
2165
+ }
2166
+ if (!authController.user && !authController.loginSkipped) {
2167
+ checkedUserRef.current = void 0;
2168
+ setAuthLoading(false);
2169
+ setAuthVerified(false);
2170
+ return;
2171
+ }
2172
+ const delegateUser = authController.user;
2173
+ if (accessGate instanceof Function && delegateUser && !deepEqual(checkedUserRef.current?.uid, delegateUser.uid)) {
2174
+ setAuthLoading(true);
2175
+ try {
2176
+ const allowed = await accessGate({
2177
+ user: delegateUser,
2178
+ authController,
2179
+ data,
2180
+ storageSource
2181
+ });
2182
+ if (!allowed) {
2183
+ authController.signOut();
2184
+ setNotAllowedError(true);
2185
+ }
2186
+ } catch (t42) {
2187
+ const e = t42;
2188
+ setNotAllowedError(e);
2189
+ authController.signOut();
2190
+ }
2191
+ setAuthLoading(false);
2192
+ setAuthVerified(true);
2193
+ checkedUserRef.current = delegateUser;
2194
+ } else {
2195
+ setAuthLoading(false);
2196
+ }
2197
+ if (!authController.initialLoading && !delegateUser) {
2198
+ setAuthVerified(true);
2199
+ }
2200
+ };
2201
+ $[3] = accessGate;
2202
+ $[4] = authController;
2203
+ $[5] = data;
2204
+ $[6] = disabled;
2205
+ $[7] = storageSource;
2206
+ $[8] = t3;
2207
+ } else {
2208
+ t3 = $[8];
2209
+ }
2210
+ const checkAccess = t3;
2211
+ let t4;
2212
+ let t5;
2213
+ if ($[9] !== checkAccess) {
2214
+ t4 = () => {
2215
+ checkAccess();
2216
+ };
2217
+ t5 = [checkAccess];
2218
+ $[9] = checkAccess;
2219
+ $[10] = t4;
2220
+ $[11] = t5;
2221
+ } else {
2222
+ t4 = $[10];
2223
+ t5 = $[11];
2224
+ }
2225
+ useEffect(t4, t5);
2226
+ let t6;
2227
+ const t7 = gateEnabled && authLoading;
2228
+ let t8;
2229
+ if ($[12] !== authVerified || $[13] !== canAccessMainView || $[14] !== notAllowedError || $[15] !== t7) {
2230
+ t8 = {
2231
+ canAccessMainView,
2232
+ authLoading: t7,
2233
+ notAllowedError,
2234
+ authVerified
2235
+ };
2236
+ $[12] = authVerified;
2237
+ $[13] = canAccessMainView;
2238
+ $[14] = notAllowedError;
2239
+ $[15] = t7;
2240
+ $[16] = t8;
2241
+ } else {
2242
+ t8 = $[16];
2243
+ }
2244
+ t6 = t8;
2245
+ return t6;
2246
+ }
2124
2247
  const googleIcon = (mode) => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 24, height: 24, children: [
2125
2248
  /* @__PURE__ */ jsxs("linearGradient", { id: "95yY7w43Oj6n2vH63j6HJb", x1: "29.401", x2: "29.401", y1: "4.064", y2: "106.734", gradientTransform: "matrix(1 0 0 -1 0 66)", gradientUnits: "userSpaceOnUse", children: [
2126
2249
  /* @__PURE__ */ jsx("stop", { offset: "0", stopColor: "#ff5840" }),
@@ -2252,7 +2375,7 @@ function FirebaseLoginView({
2252
2375
  } else if (notAllowedError instanceof Error) {
2253
2376
  notAllowedMessage = notAllowedError.message;
2254
2377
  } else {
2255
- notAllowedMessage = "It looks like you don't have access to the CMS, based on the specified Authenticator configuration";
2378
+ notAllowedMessage = "It looks like you don't have access to the CMS, based on the specified access gate configuration";
2256
2379
  }
2257
2380
  }
2258
2381
  const fadeStyle = {
@@ -2639,7 +2762,7 @@ function RebaseFirebaseApp(t0) {
2639
2762
  name,
2640
2763
  logo,
2641
2764
  logoDark,
2642
- authenticator,
2765
+ accessGate,
2643
2766
  collections,
2644
2767
  views,
2645
2768
  adminViews,
@@ -2767,15 +2890,15 @@ function RebaseFirebaseApp(t0) {
2767
2890
  t10 = $[21];
2768
2891
  }
2769
2892
  let t11;
2770
- if ($[22] !== authController || $[23] !== authenticator || $[24] !== storageSource || $[25] !== t10) {
2893
+ if ($[22] !== accessGate || $[23] !== authController || $[24] !== storageSource || $[25] !== t10) {
2771
2894
  t11 = {
2772
2895
  authController,
2773
- authenticator,
2896
+ accessGate,
2774
2897
  data: t10,
2775
2898
  storageSource
2776
2899
  };
2777
- $[22] = authController;
2778
- $[23] = authenticator;
2900
+ $[22] = accessGate;
2901
+ $[23] = authController;
2779
2902
  $[24] = storageSource;
2780
2903
  $[25] = t10;
2781
2904
  $[26] = t11;
@@ -2786,7 +2909,7 @@ function RebaseFirebaseApp(t0) {
2786
2909
  authLoading,
2787
2910
  canAccessMainView,
2788
2911
  notAllowedError
2789
- } = useValidateAuthenticator(t11);
2912
+ } = useFirebaseAccessGate(t11);
2790
2913
  let t12;
2791
2914
  if ($[27] !== userConfigPersistence) {
2792
2915
  t12 = {
@@ -2914,7 +3037,7 @@ function RebaseFirebaseApp(t0) {
2914
3037
  const usedLogo = modeController.mode === "dark" && logoDark ? logoDark : logo;
2915
3038
  if (!canAccessMainView) {
2916
3039
  const LoginViewUsed = components?.LoginView ?? FirebaseLoginView;
2917
- component = /* @__PURE__ */ jsx(LoginViewUsed, { logo: usedLogo, allowSkipLogin, signInOptions: signInOptions ?? DEFAULT_SIGN_IN_OPTIONS, firebaseApp, authController, notAllowedError });
3040
+ component = /* @__PURE__ */ jsx(LoginViewUsed, { logo: usedLogo, allowSkipLogin, signInOptions: signInOptions ?? DEFAULT_SIGN_IN_OPTIONS, firebaseApp, authController, notAllowedError: notAllowedError instanceof Error ? notAllowedError : typeof notAllowedError === "string" ? notAllowedError : void 0 });
2918
3041
  } else {
2919
3042
  const firstCollectionEntry = navigationStateController.topLevelNavigation?.navigationEntries.find(_temp3);
2920
3043
  const fallbackRoute = firstCollectionEntry ? /* @__PURE__ */ jsx(Navigate, { to: urlController.buildUrlCollectionPath(firstCollectionEntry.id), replace: true }) : /* @__PURE__ */ jsx(CenteredView, { children: "No home page or collections provided." });
@@ -3049,6 +3172,7 @@ export {
3049
3172
  performPineconeTextSearch,
3050
3173
  useAppCheck,
3051
3174
  useBuildUserManagement,
3175
+ useFirebaseAccessGate,
3052
3176
  useFirebaseAuthController,
3053
3177
  useFirebaseRTDBDelegate,
3054
3178
  useFirebaseStorageSource,