@spidy092/auth-client 1.0.13 → 1.0.14
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/core.js +21 -21
- package/package.json +1 -1
package/core.js
CHANGED
|
@@ -212,26 +212,26 @@ export async function refreshToken() {
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
|
|
215
|
-
export async function refreshToken() {
|
|
216
|
-
|
|
215
|
+
// export async function refreshToken() {
|
|
216
|
+
// const { clientKey, authBaseUrl } = getConfig();
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
// console.log('🔄 Refreshing token:', { clientKey, mode: isRouterMode() ? 'ROUTER' : 'CLIENT' });
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
220
|
+
// try {
|
|
221
|
+
// const response = await fetch(`${authBaseUrl}/refresh/${clientKey}`, {
|
|
222
|
+
// method: 'POST',
|
|
223
|
+
// credentials: 'include',
|
|
224
|
+
// });
|
|
225
|
+
|
|
226
|
+
// if (!response.ok) {
|
|
227
|
+
// throw new Error('Refresh failed');
|
|
228
|
+
// }
|
|
229
|
+
|
|
230
|
+
// const { access_token } = await response.json();
|
|
231
|
+
// setToken(access_token);
|
|
232
|
+
// return access_token;
|
|
233
|
+
// } catch (err) {
|
|
234
|
+
// clearToken();
|
|
235
|
+
// throw err;
|
|
236
|
+
// }
|
|
237
|
+
// }
|