diff --git a/src/components/Api/Api.tsx b/src/components/Api/Api.tsx index 47d5bf7..8820598 100644 --- a/src/components/Api/Api.tsx +++ b/src/components/Api/Api.tsx @@ -88,11 +88,11 @@ export async function TokenRefresh() { "Token refresh success! New Access Token", response.data.access );*/ - return [true]; + return true; }) .catch((error) => { - console.log("Refresh Failed: " + JSON.stringify(error.response.data)); - return [false, error.response.data]; + console.log("Refresh Failed: " + JSON.stringify(error.response)); + return false; }); } export async function UserInfo() { diff --git a/src/routes/Revalidation/Revalidation.tsx b/src/routes/Revalidation/Revalidation.tsx index bee1ca4..df677e5 100644 --- a/src/routes/Revalidation/Revalidation.tsx +++ b/src/routes/Revalidation/Revalidation.tsx @@ -17,7 +17,7 @@ export default function Revalidation() { useEffect(() => { setState("Previous session found"); TokenRefresh().then(async (response) => { - if (response[0]) { + if (response) { let user_info = await UserInfo(); await dispatch(setUser(user_info)); if (!(user_info.year_level || user_info.course || user_info.semester)) {