1
0
Fork 0
mirror of synced 2024-10-01 01:28:51 +13:00

Adding a page reload when 403 occurs, if token has expired this will return to login page.

This commit is contained in:
mike12345567 2021-06-22 12:39:52 +01:00
parent 373c57580a
commit 21a2632da7

View file

@ -43,7 +43,8 @@ const makeApiCall = async ({ method, url, body, json = true }) => {
case 400:
return handleError(`${url}: Bad Request`)
case 403:
notificationStore.danger("Forbidden")
// reload the page incase the token has expired
location.reload()
return handleError(`${url}: Forbidden`)
default:
if (response.status >= 200 && response.status < 400) {