fix(authContext.tsx): add check for isAuthenticated before attempting to logout to prevent unnecessary logout calls

This commit is contained in:
cristhianzl 2024-01-11 10:02:13 -03:00
commit 030eed7804

View file

@ -104,6 +104,9 @@ export function AuthProvider({ children }): React.ReactElement {
}
async function logout() {
if (!isAuthenticated) {
return;
}
try {
await requestLogout();
cookies.remove("apikey_tkn_lflw", { path: "/" });