Skip to content

Commit

Permalink
Fixed issue with session expiry
Browse files Browse the repository at this point in the history
+ Fixed issue with session expiry not giving correct reason to user and allowing them to relogin
  • Loading branch information
Arisamiga committed Sep 13, 2024
1 parent 7f534b7 commit 2607cce
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"serverError": "The server is currently down. Please try again later.",
"sendCodeError": "Failed to send verification code.",
"codeFormLabel": "We have send a <a href='https://catwar.su/ls'>PM</a> to your account please enter the 6 digit code below",
"sessionError": "Session has expired. Please try to relogin.",
"sizeError": "The image is too large. Please make sure it is 100x150",
"back": "&larr; Back",
"submitCode": "Submit",
Expand Down
1 change: 1 addition & 0 deletions lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"serverError": "Сервер в настоящее время не работает. Пожалуйста, попробуйте позже.",
"codeFormLabel": "Мы отправили <a href='https://catwar.su/ls'>ЛС</a> на ваш аккаунт, пожалуйста, введите 6-значный код ниже",
"sizeError": "Изображение слишком большое. Пожалуйста, убедитесь, что оно 100x150",
"sessionError": "Сессия истекла. Пожалуйста, попробуйте войти снова.",
"back": "&larr; назад",
"submitCode": "Отправить",
"logout": "Выйти",
Expand Down
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_version": 3,
"name": "Costume-Client",
"description": "Client for Costume Mod by #SaveCW",
"version": "1.0.0",
"description": "Client for Costume Mod by #SaveCW | Клиент для мода на костюмы от #SaveCW",
"version": "1.0.1",
"action": {
"default_popup": "main.html",
"default_icon": "./icons/icon.png"
Expand Down
9 changes: 9 additions & 0 deletions script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ document.getElementsByClassName("changeCostume")[0].addEventListener("click", fu
});
});
}
else if (response.status === 403) {
// Session went kaboom
setStatus(translation["langdata"]["sessionError"], "error");

// Simulate click on the logout button
setTimeout(() => {
document.getElementById("logout").click();
}, 3000);
}
else {
setStatus(translation["langdata"]["costumeError"], "error");
}
Expand Down

0 comments on commit 2607cce

Please sign in to comment.