fix(authContext.tsx): add check for isAuthenticated before attempting to logout to prevent unnecessary logout calls
This commit is contained in:
parent
369ca587fa
commit
030eed7804
1 changed files with 3 additions and 0 deletions
|
|
@ -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: "/" });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue