bradtraversy / proshop_mern

Shopping cart built with MERN & Redux
1.99k stars 1.18k forks source link

Register Screen is available to register even after user Logged In #146

Closed Nishthavan closed 3 years ago

Nishthavan commented 3 years ago

We can see if the user Logged in and revoke access to the Register screen for the user logged In

basir commented 3 years ago

hello there, based on this condition: https://github.com/bradtraversy/proshop_mern/blob/master/frontend/src/screens/RegisterScreen.js#L25 if logged user try to open register screen then we redirect the user to home screen.

Nishthavan commented 3 years ago

But we are getting user info in that by register user state which will be empty for a logged in user by login form and hence user info will not be there. Besides this shouldn't we get it from logged user also and check for the same using an or condition