@sabuj0338/axios-friday 1.2.0 → 1.3.0
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 +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -178,7 +178,11 @@ var Friday = class {
|
|
|
178
178
|
* `refreshTokenKey` specified in the configuration.
|
|
179
179
|
*/
|
|
180
180
|
getRefreshToken() {
|
|
181
|
-
|
|
181
|
+
if (this.config.storage == "cookie") {
|
|
182
|
+
return this.config.refreshTokenKey && import_js_cookie.default.get(this.config.refreshTokenKey);
|
|
183
|
+
} else if (this.config.storage == "local") {
|
|
184
|
+
return this.config.refreshTokenKey && (localStorage.getItem(this.config.refreshTokenKey) || void 0);
|
|
185
|
+
}
|
|
182
186
|
}
|
|
183
187
|
/**
|
|
184
188
|
* The function `getAuthorizationHeader` returns an object with an Authorization header containing a
|
package/dist/index.mjs
CHANGED
|
@@ -142,7 +142,11 @@ var Friday = class {
|
|
|
142
142
|
* `refreshTokenKey` specified in the configuration.
|
|
143
143
|
*/
|
|
144
144
|
getRefreshToken() {
|
|
145
|
-
|
|
145
|
+
if (this.config.storage == "cookie") {
|
|
146
|
+
return this.config.refreshTokenKey && Cookies.get(this.config.refreshTokenKey);
|
|
147
|
+
} else if (this.config.storage == "local") {
|
|
148
|
+
return this.config.refreshTokenKey && (localStorage.getItem(this.config.refreshTokenKey) || void 0);
|
|
149
|
+
}
|
|
146
150
|
}
|
|
147
151
|
/**
|
|
148
152
|
* The function `getAuthorizationHeader` returns an object with an Authorization header containing a
|
package/package.json
CHANGED