reactfire 4.2.2 → 4.2.3-exp.9754f86
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/auth.d.ts +5 -5
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/src/auth.tsx +6 -13
package/dist/auth.d.ts
CHANGED
|
@@ -73,20 +73,20 @@ export interface SignInCheckOptionsClaimsValidator extends SignInCheckOptionsBas
|
|
|
73
73
|
*
|
|
74
74
|
* ```ts
|
|
75
75
|
* // pass in an object describing the custom claims a user must have
|
|
76
|
-
* const {status, data: signInCheckResult} =
|
|
76
|
+
* const {status, data: signInCheckResult} = useSigninCheck({requiredClaims: {admin: true}});
|
|
77
77
|
*
|
|
78
78
|
* // pass in a custom claims validator function
|
|
79
|
-
* const {status, data: signInCheckResult} =
|
|
79
|
+
* const {status, data: signInCheckResult} = useSigninCheck({validateCustomClaims: (userClaims) => {
|
|
80
80
|
* // custom validation logic...
|
|
81
81
|
* }});
|
|
82
82
|
*
|
|
83
83
|
* // You can optionally force-refresh the token
|
|
84
|
-
* const {status, data: signInCheckResult} =
|
|
84
|
+
* const {status, data: signInCheckResult} = useSigninCheck({forceRefresh: true, requiredClaims: {admin: true}});
|
|
85
85
|
* ```
|
|
86
86
|
*/
|
|
87
87
|
export declare function useSigninCheck(options?: SignInCheckOptionsBasic | SignInCheckOptionsClaimsObject | SignInCheckOptionsClaimsValidator): ObservableStatus<SigninCheckResult>;
|
|
88
88
|
/**
|
|
89
|
-
* @deprecated Use `
|
|
89
|
+
* @deprecated Use `useSigninCheck` instead
|
|
90
90
|
*
|
|
91
91
|
* Conditionally render children based on [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
|
|
92
92
|
*
|
|
@@ -94,7 +94,7 @@ export declare function useSigninCheck(options?: SignInCheckOptionsBasic | SignI
|
|
|
94
94
|
*/
|
|
95
95
|
export declare function ClaimsCheck({ user, fallback, children, requiredClaims }: ClaimsCheckProps): JSX.Element;
|
|
96
96
|
/**
|
|
97
|
-
* @deprecated Use `
|
|
97
|
+
* @deprecated Use `useSigninCheck` instead
|
|
98
98
|
*
|
|
99
99
|
* Conditionally render children based on signed-in status and [custom claims](https://firebase.google.com/docs/auth/admin/custom-claims).
|
|
100
100
|
*
|
package/dist/index.js
CHANGED
|
@@ -1473,7 +1473,7 @@ function xe(e) {
|
|
|
1473
1473
|
return { unsubscribe: n };
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
1476
|
-
const Xn = "[DEFAULT]", bt = f.createContext(void 0), Ie = f.createContext(!1), er = "4.2.
|
|
1476
|
+
const Xn = "[DEFAULT]", bt = f.createContext(void 0), Ie = f.createContext(!1), er = "4.2.3-exp.9754f86", tr = (e, t) => e === t || [...Object.keys(e), ...Object.keys(t)].every((n) => e[n] === t[n]);
|
|
1477
1477
|
function Lr(e) {
|
|
1478
1478
|
const {
|
|
1479
1479
|
firebaseConfig: t,
|
|
@@ -1521,9 +1521,8 @@ function Wr(e) {
|
|
|
1521
1521
|
});
|
|
1522
1522
|
}
|
|
1523
1523
|
function nr(e) {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
return n.currentUser !== void 0 && (o.initialData = n.currentUser, o.startWithValue = n.currentUser), g(r, i, o);
|
|
1524
|
+
const t = kt(), n = `auth:user:${t.name}`, r = xe(t);
|
|
1525
|
+
return g(n, r, e);
|
|
1527
1526
|
}
|
|
1528
1527
|
function rr(e, t = !1, n) {
|
|
1529
1528
|
if (!e)
|