Browse Source

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

gh-pages
mike12345567 5 years ago
parent
commit
21a2632da7
  1. 3
      packages/client/src/api/api.js

3
packages/client/src/api/api.js

@ -43,7 +43,8 @@ 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:
notificationStore.danger("Forbidden") // reload the page incase the token has expired
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…
Cancel
Save