Merge branch 'develop' of github.com:thecodingmachine/workadventure

This commit is contained in:
_Bastler
2021-12-09 08:14:10 +01:00
4 changed files with 23 additions and 8 deletions
+6
View File
@@ -13,6 +13,12 @@ axiosWithRetry.defaults.raxConfig = {
maxRetryAfter: 60_000,
statusCodesToRetry: [
[100, 199],
[429, 429],
[501, 599],
],
// You can detect when a retry is happening, and figure out how many
// retry attempts have been made
onRetryAttempt: (err) => {
+4 -3
View File
@@ -115,11 +115,12 @@ export class Room {
this._contactPage = data.contactPage || CONTACT_URL;
return new MapDetail(data.mapUrl, data.textures);
} catch (e) {
console.error("Error => getMapDetail", e, e.response);
//TODO fix me and manage Error class
if (e.response?.data === "Token decrypted error") {
if (axios.isAxiosError(e) && e.response?.status == 401 && e.response?.data === "Token decrypted error") {
console.warn("JWT token sent could not be decrypted. Maybe it expired?");
localUserStore.setAuthToken(null);
window.location.assign("/login");
} else {
console.error("Error => getMapDetail", e, e.response);
}
throw e;
}