react-redux-django-auth 1.3.9 → 1.4.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/index.js +6 -27
- package/dist/index.mjs +5 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1340,7 +1340,7 @@ var useAuthicatedUser = function(apiURL, location) {
|
|
|
1340
1340
|
]);
|
|
1341
1341
|
(0, import_react5.useEffect)(function() {
|
|
1342
1342
|
if (isAuthenticated) {
|
|
1343
|
-
var
|
|
1343
|
+
var runUserLoad = function() {
|
|
1344
1344
|
return _async_to_generator(function() {
|
|
1345
1345
|
return _ts_generator(this, function(_state) {
|
|
1346
1346
|
switch(_state.label){
|
|
@@ -1360,35 +1360,15 @@ var useAuthicatedUser = function(apiURL, location) {
|
|
|
1360
1360
|
});
|
|
1361
1361
|
})();
|
|
1362
1362
|
};
|
|
1363
|
-
|
|
1363
|
+
runUserLoad();
|
|
1364
1364
|
}
|
|
1365
1365
|
}, [
|
|
1366
1366
|
dispatch,
|
|
1367
|
-
|
|
1368
|
-
|
|
1367
|
+
isAuthenticated,
|
|
1368
|
+
apiURL
|
|
1369
1369
|
]);
|
|
1370
1370
|
var refreshUser = (0, import_react5.useCallback)(function() {
|
|
1371
|
-
|
|
1372
|
-
return _async_to_generator(function() {
|
|
1373
|
-
return _ts_generator(this, function(_state) {
|
|
1374
|
-
switch(_state.label){
|
|
1375
|
-
case 0:
|
|
1376
|
-
setIsUserLoading(true);
|
|
1377
|
-
return [
|
|
1378
|
-
4,
|
|
1379
|
-
dispatch(load_user(apiURL))
|
|
1380
|
-
];
|
|
1381
|
-
case 1:
|
|
1382
|
-
_state.sent();
|
|
1383
|
-
setIsUserLoading(false);
|
|
1384
|
-
return [
|
|
1385
|
-
2
|
|
1386
|
-
];
|
|
1387
|
-
}
|
|
1388
|
-
});
|
|
1389
|
-
})();
|
|
1390
|
-
};
|
|
1391
|
-
loadAndFinish();
|
|
1371
|
+
dispatch(load_user(apiURL));
|
|
1392
1372
|
}, [
|
|
1393
1373
|
dispatch,
|
|
1394
1374
|
apiURL
|
|
@@ -1398,14 +1378,13 @@ var useAuthicatedUser = function(apiURL, location) {
|
|
|
1398
1378
|
return _ts_generator(this, function(_state) {
|
|
1399
1379
|
switch(_state.label){
|
|
1400
1380
|
case 0:
|
|
1401
|
-
setIsAuthLoading(true);
|
|
1402
1381
|
return [
|
|
1403
1382
|
4,
|
|
1404
1383
|
dispatch(checkAuthenticated(apiURL))
|
|
1405
1384
|
];
|
|
1406
1385
|
case 1:
|
|
1407
1386
|
_state.sent();
|
|
1408
|
-
|
|
1387
|
+
dispatch(load_user(apiURL));
|
|
1409
1388
|
return [
|
|
1410
1389
|
2
|
|
1411
1390
|
];
|
package/dist/index.mjs
CHANGED
|
@@ -479,26 +479,20 @@ var useAuthicatedUser = (apiURL, location) => {
|
|
|
479
479
|
}, [dispatch, apiURL, location]);
|
|
480
480
|
useEffect4(() => {
|
|
481
481
|
if (isAuthenticated) {
|
|
482
|
-
const
|
|
482
|
+
const runUserLoad = async () => {
|
|
483
483
|
setIsUserLoading(true);
|
|
484
484
|
await dispatch(load_user(apiURL));
|
|
485
485
|
setIsUserLoading(false);
|
|
486
486
|
};
|
|
487
|
-
|
|
487
|
+
runUserLoad();
|
|
488
488
|
}
|
|
489
|
-
}, [dispatch,
|
|
489
|
+
}, [dispatch, isAuthenticated, apiURL]);
|
|
490
490
|
const refreshUser = useCallback5(() => {
|
|
491
|
-
|
|
492
|
-
setIsUserLoading(true);
|
|
493
|
-
await dispatch(load_user(apiURL));
|
|
494
|
-
setIsUserLoading(false);
|
|
495
|
-
};
|
|
496
|
-
loadAndFinish();
|
|
491
|
+
dispatch(load_user(apiURL));
|
|
497
492
|
}, [dispatch, apiURL]);
|
|
498
493
|
const refreshAuth = useCallback5(async () => {
|
|
499
|
-
setIsAuthLoading(true);
|
|
500
494
|
await dispatch(checkAuthenticated(apiURL));
|
|
501
|
-
|
|
495
|
+
dispatch(load_user(apiURL));
|
|
502
496
|
}, [dispatch, apiURL]);
|
|
503
497
|
const clearErrorsWrapper = useCallback5(() => {
|
|
504
498
|
dispatch(clearErrors());
|