Relative Content

Tag Archive for reactjsfirebasefirebase-authenticationreact-routerreact-context

The redirection to the main page after login or registration only works after the second form submission (only on Mobile)

In my Group Counter App, I implemented authorization functionality. Earlier, I had a problem with authorization on PC, and I created a question where I solved my problem. However, now that I have finished my app, I noticed that this problem still exists on mobile. I don’t encounter any problems with logging in on my PC, but when I try to sign in or sign up from a mobile device (in my case, an iPhone 13), after I log in, I stay on the same page. I need to submit the form a second time to be redirected to the menu page (in my case, “/”).

Issue with private route accessibility when typing the URL manually in the browser

I want to access routes manually by typing the URL address in the browser if the user is logged in. If the user is not logged in, I want to redirect the page to the login page. Additionally, I want the Log In and Sign Up pages to be accessible by typing their URL paths manually public in a browser. However, currently, I am redirected to the login page every time I try to access any of the private routes manually, whether I am logged in or not.