I have a chap app where user first fills up a form then they are redirected to the chat page. Now the problem is when user clicks the back button they goes back to the login form.
So I used this code to prevent going back,
history.pushState({}, '', "inbox");
history.pushState({}, '', "again-inbox");
window.onpopstate = ()=>{
history.forward();
}
It works fine on PC but does not work on android browsers.