diff --git a/frontend/frontend/src/api/user.js b/frontend/frontend/src/api/user.js index 1d336535..87baf7d8 100644 --- a/frontend/frontend/src/api/user.js +++ b/frontend/frontend/src/api/user.js @@ -1,6 +1,7 @@ import axios from 'axios'; import { HOST } from '../constants'; +import { logout } from '../redux/actions/userActions'; const authenticate = async (code, privateAccess, userKey) => { try { @@ -26,6 +27,9 @@ const getUserMetadata = async (userKey) => { const result = await axios.get(fullUrl); return result.data; } catch (error) { + if (error.response && error.response.status === 404) { + logout(userKey); + } console.error(error); return null; }