react-redux-django-auth 1.4.7 → 1.4.8
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.
|
@@ -60,7 +60,8 @@ import { getBaseURL } from "../apis/config";
|
|
|
60
60
|
export var setupAuth = function (storage) {
|
|
61
61
|
var isRefreshing = false;
|
|
62
62
|
var failedQueue = [];
|
|
63
|
-
|
|
63
|
+
// 1. Declare the variable but don't initialize it yet
|
|
64
|
+
var api;
|
|
64
65
|
var processQueue = function (error, token) {
|
|
65
66
|
if (token === void 0) { token = null; }
|
|
66
67
|
failedQueue.forEach(function (prom) {
|
|
@@ -69,6 +70,9 @@ export var setupAuth = function (storage) {
|
|
|
69
70
|
failedQueue = [];
|
|
70
71
|
};
|
|
71
72
|
var initialize = function () {
|
|
73
|
+
// 2. Initialize the API here!
|
|
74
|
+
// This only runs when the user calls auth.initialize() in their App/Layout.
|
|
75
|
+
api = createApi(getBaseURL());
|
|
72
76
|
api.interceptors.request.use(function (config) { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
77
|
var token;
|
|
74
78
|
return __generator(this, function (_a) {
|