@pagamio/frontend-commons-lib 0.8.256 → 0.8.259
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.
|
@@ -73,11 +73,13 @@ export class TokenManager {
|
|
|
73
73
|
},
|
|
74
74
|
body: JSON.stringify(oldRefreshToken ? { refreshToken: oldRefreshToken } : {}),
|
|
75
75
|
});
|
|
76
|
-
const
|
|
76
|
+
const json = await response.json();
|
|
77
77
|
if (!response.ok) {
|
|
78
|
-
throw new Error(
|
|
78
|
+
throw new Error(json.error || json.message || 'Failed to refresh token');
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
// Backend may wrap response in { success, data } or return flat
|
|
81
|
+
const payload = json.data ?? json;
|
|
82
|
+
const { accessToken, accessTokenExpiresIn, refreshToken: newRefreshToken, refreshTokenExpiresIn } = payload;
|
|
81
83
|
// Default to 1 hour if the backend doesn't return accessTokenExpiresIn
|
|
82
84
|
const expiresIn = accessTokenExpiresIn || 3600;
|
|
83
85
|
this.handleAuthTokens({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.259",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|