@applica-software-guru/react-admin 1.4.0-beta.5 → 1.4.0-beta.7
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/components/Layout/Header/Profile/buttons/StopImpersonateButton.d.ts.map +1 -1
- package/dist/components/Layout/Provider.d.ts.map +1 -1
- package/dist/react-admin.cjs.js +1 -1
- package/dist/react-admin.cjs.js.map +1 -1
- package/dist/react-admin.es.js +10 -2
- package/dist/react-admin.es.js.map +1 -1
- package/dist/react-admin.umd.js +1 -1
- package/dist/react-admin.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Layout/Header/Profile/buttons/StopImpersonateButton.tsx +2 -0
- package/src/components/Layout/Provider.tsx +7 -1
package/package.json
CHANGED
|
@@ -15,6 +15,8 @@ const StopImpersonateButton = () => {
|
|
|
15
15
|
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
if (!authProvider.isImpersonating) {
|
|
18
|
+
// eslint-disable-next-line no-console
|
|
19
|
+
console.warn('The authProvider does not support the isImpersonating feature', authProvider);
|
|
18
20
|
return;
|
|
19
21
|
}
|
|
20
22
|
authProvider.isImpersonating().then((isImpersonating: boolean) => setIsImpersonating(isImpersonating));
|
|
@@ -219,7 +219,13 @@ function LayoutProvider(props: ILayoutProviderProps) {
|
|
|
219
219
|
}, [theme.palette.mode]);
|
|
220
220
|
|
|
221
221
|
useEffect(() => {
|
|
222
|
-
authProvider
|
|
222
|
+
// Check if authProvider contains a method called isImpersonating
|
|
223
|
+
if (!authProvider.isImpersonating) {
|
|
224
|
+
// eslint-disable-next-line no-console
|
|
225
|
+
console.warn('authProvider does not contain a method called isImpersonating', authProvider);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
authProvider?.isImpersonating().then((isImpersonating: boolean) => {
|
|
223
229
|
setNeedToChangePassword(!isImpersonating && identity?.data?.needToChangePassword === true);
|
|
224
230
|
});
|
|
225
231
|
}, [identity?.data?.needToChangePassword, authProvider]);
|