How do I log in or register correctly to go back so as not to leave my site? #85561
Unanswered
youngFrontendDeveloper
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
The project is on Next.js app v14.
How can I determine the previous page address in order to go back if it is a page of my site, or go to the main page if the previous page is someone else's (for example, the user immediately entered in the search www.my-site/login )?
document.referrer.includes(window.location.origin) - always false, because document.referrer is empty.
Additional information
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions