Skip to content

Commit

Permalink
chore: minor refactor (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
aversini authored Jul 3, 2024
1 parent e582858 commit 6639cf9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const AuthProvider = ({

const removeStateAndLocalStorage = useCallback(
(logoutReason?: string) => {
console.warn(logoutReason);
setAuthState({
isLoading: false,
isAuthenticated: false,
Expand Down Expand Up @@ -230,22 +231,18 @@ export const AuthProvider = ({
return response.accessToken;
}
removeStateAndLocalStorage(ACCESS_TOKEN_ERROR);
console.error(ACCESS_TOKEN_ERROR);
return "";
}
/**
* refreshToken is not valid, so we need to re-authenticate the user.
*/
removeStateAndLocalStorage(ACCESS_TOKEN_ERROR);
console.error(ACCESS_TOKEN_ERROR);
return "";
}
removeStateAndLocalStorage(ACCESS_TOKEN_ERROR);
console.error(ACCESS_TOKEN_ERROR);
return "";
} catch (_error) {
removeStateAndLocalStorage(ACCESS_TOKEN_ERROR);
console.error(ACCESS_TOKEN_ERROR);
return "";
}
};
Expand Down

0 comments on commit 6639cf9

Please sign in to comment.