MERN-Restaurant-App icon indicating copy to clipboard operation
MERN-Restaurant-App copied to clipboard

Better to use isAuth boolean than checking the presence of user

Open sagarkattel opened this issue 1 year ago • 0 comments

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

sagarkattel avatar Oct 04 '23 19:10 sagarkattel