After the login or registration are processed in the app process, how can the back key skip the login and registration interfaces?

i am bulding a mobile app … the login screen is a modal-in on the same page with the home page…
at the launch the modal-in appear… when the user is logged the login modal disapear and the home page appear…
but when the user go to another page and come back the login modal launch it self again…


{{#if loggedIn}}
// page content
{{else}}
//login modal
{{/if}}

data: function () {
return { loggedIn: false }
},

methods: {
connexion: function (){
const self = this; const app = self.$f7; var $$ = self.$dom7; var pwd = $$("#password").val();
if(pwd== 1234){
this.$setState({ loggedIn: true });
}
}