I’m develop application with authenthification module. App has state ready:true when auth is complete.
app.js entry
var app = core.create({
id: 'AuthApp',
name: 'Test aspp',
version: '0.1.0',
debug: true,
start: 'Auth',
main: '/sidemenu'
});
app = webix.extend({
Auth: function(user, pass){
///Auth code return promise
},
LoadPage: function(page, param){
var main = this.config.main;
var rslt = main + '/' + page;
this.show(rslt);
}
}, app);
return app;
auth.js
define(['app', 'login_form'], function(app, form){
return {
$ui: login_form,
$oninit: function(view){
view.$$('submit').attachEvent('onItemClick', function(){
var data = view.$$('form').getValues();
app.Auth(data)
.then(app.LoadPage.bind(app, app.config.main))
.catch(function(){
view.$$('form').markInvalid("login", "Login Error!");
});
});
}
}
});
If write URL manualy in browser #!/sidemenu/Other_Page - user have access without auth. How I can disable access to other page?