MERN-Restaurant-App
MERN-Restaurant-App copied to clipboard
Better to use isAuth boolean than checking the presence of user
Took a glance at you code and I found that to validate the user authentication you have checked it with the presence of user data from the authSlice. Instead what we can do is we add isLogin boolean in the authSlice and set it in the state when logged in and only check isLogged in status instead of checking userdetail