Hello, I’m trying to migrate my app in v1 to v3, to benefit from all the news. The first difficulty encountered is the new management of the routes. Above all with the login page. You can help me. Here is the code I use on v1:
At the start of the effect app a check if the user has logged in this way:
var user = window.localStorage.getItem ("user");
if (! (user)) {
myApp.loginScreen ();
} else {
// code app
}
If the user is not present I open the modal to login or register
var mainView = app.views.create('.view-main', {
on: {
pageInit: function() {
console.log('page init')
// example, here I will put my verification code
var a = 1;
if (a == 10) {
app.loginScreen.open('.login-screen');
}
}
}
})