updates and fixes

* seo friendly urls
* custom client serve-static module
* database fixes
* fix recent pages
* other fixes
This commit is contained in:
Philipinho
2024-05-18 03:19:42 +01:00
parent eefe63d1cd
commit 9c7c2f1163
102 changed files with 921 additions and 536 deletions

View File

@ -38,15 +38,22 @@ api.interceptors.response.use(
switch (error.response.status) {
case 401:
// Handle unauthorized error
if (window.location.pathname != Routes.AUTH.LOGIN) {
window.location.href = Routes.AUTH.LOGIN;
}
Cookies.remove("authTokens");
redirectToLogin();
break;
case 403:
// Handle forbidden error
break;
case 404:
// Handle not found error
if (
error.response.data.message
.toLowerCase()
.includes("workspace not found")
) {
Cookies.remove("authTokens");
redirectToLogin();
}
break;
case 500:
// Handle internal server error
@ -59,4 +66,13 @@ api.interceptors.response.use(
},
);
function redirectToLogin() {
if (
window.location.pathname != Routes.AUTH.LOGIN &&
window.location.pathname != Routes.AUTH.SIGNUP
) {
window.location.href = Routes.AUTH.LOGIN;
}
}
export default api;