Answer the question
In order to leave comments, you need to log in
How, when clicking on the back button of the browser, send the user to the previous site?
Such a situation, after authorization, I want to block the user from entering the login page. I coped with this, but when the user presses the back button from the next page after the login, nothing happens, since he cannot enter this page. Can I somehow determine that it was the browser's back button that was pressed and at the same time send it to the page that was before login?
Answer the question
In order to leave comments, you need to log in
Read about history.replaceState(). With it, you can replace the current authorization page in the browser history. Thus, when you click the "Back" button, the user will be sent to the page on which he was BEFORE the authorization page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question