Open bharatpaliwal-169 opened 2 years ago
@bharatpaliwal-169 hi, I just arrived at 4:29:23; have u successfully logged in through google? and also signed up? my page is just still and no error come out T^T
Hi @rua02me , No google npm package is depricated and using new react-google-auth package need a lot of efforts , since project is long i suggest to skip this and continue forward
In your client App.js file make this change to stop the sign in button from redirecting to /posts and make sure it only redirects to /auth. Hope this helps!
component={() => (!user ? <Auth /> : <Redirect to="/posts" />)} />
==> <Route path="/auth" exact component={Auth} />
The problem for me was I used the google sign in and set the user in localStorage but did not use googleLogout so localStorage thinks a user is still logged in and constantly redirects the sign in button to /posts.
BUG
When we are there on site for long and then when we logout, without explicitly hard refreshing the page, if we logout then again if we click on the button the page refreshes and lands to /posts instead of going to /auth.If someone ever came across this and have solved it kindly share the approach. Thanks in advance.