Don't reload client app on 403, just show an error instead
This commit is contained in:
parent
aa0906bcad
commit
414a7dbee6
|
@ -43,10 +43,9 @@ const makeApiCall = async ({ method, url, body, json = true }) => {
|
||||||
case 400:
|
case 400:
|
||||||
return handleError(`${url}: Bad Request`)
|
return handleError(`${url}: Bad Request`)
|
||||||
case 403:
|
case 403:
|
||||||
// reload the page incase the token has expired
|
notificationStore.danger(
|
||||||
if (!url.includes("self")) {
|
"Your session has expired, or you don't have permission to access that data"
|
||||||
location.reload()
|
)
|
||||||
}
|
|
||||||
return handleError(`${url}: Forbidden`)
|
return handleError(`${url}: Forbidden`)
|
||||||
default:
|
default:
|
||||||
if (response.status >= 200 && response.status < 400) {
|
if (response.status >= 200 && response.status < 400) {
|
||||||
|
|
Loading…
Reference in New Issue