logging out

This commit is contained in:
talksik
2022-05-13 08:26:46 -05:00
parent 98b559e972
commit a68d53b779
4 changed files with 10 additions and 5 deletions
@@ -36,8 +36,6 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
}, [jwtToken, fetchUser]);
const handleLogout = useCallback(() => {
setJwtToken(undefined);
// ?should this be set here? what's a better way of
NirvanaApi._jwtToken = null;
@@ -48,6 +46,8 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
.catch(() => {
toast.error('logged out');
});
setJwtToken(undefined);
}, [fetchUser, setJwtToken]);
const handleSetJwtToken = useCallback(