My Angular app uses auth0
, and after the login is successful, auth0 will redirect the user to my website's /callback
.
It's working completely fine, but I want to prevent the user to reach this /callback
state by hitting the "previous page" button for example.
Because navigating to /callback
after being succesfully authenticated will display an error.
What is the best way to achieve this ?
Use _router.navigate([your, redirect, route], { replaceUrl: true });
to replace current state.
https://angular.io/api/router/NavigationExtras#replaceUrl