Skip to content

Commit 258374e

Browse files
author
Gareth Redfern
committed
Merge branch 'main' into feature/file-upload
2 parents e818f55 + 41c3b99 commit 258374e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/services/API.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ apiClient.interceptors.response.use(
2121
return response;
2222
},
2323
function (error) {
24-
if (error.response.status === 401 || error.response.status === 419) {
24+
if (
25+
error.response &&
26+
(error.response.status === 401 || error.response.status === 419)
27+
) {
2528
store.dispatch("auth/logout");
2629
}
2730
return Promise.reject(error);

src/services/AuthService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ authClient.interceptors.response.use(
1414
return response;
1515
},
1616
function (error) {
17-
if (error.response.status === 401 || error.response.status === 419) {
17+
if (
18+
error.response &&
19+
(error.response.status === 401 || error.response.status === 419)
20+
) {
1821
store.dispatch("auth/logout");
1922
}
2023
return Promise.reject(error);

0 commit comments

Comments
 (0)