Change page that will be loaded based on variable


i’m using simple system to log users. If data is filled, im writing this data in application-settings.
So for now, i want to check if user is already logged, and show login page or main page.

I wrote this piece of code in app.js but this will not work. Is there a way to accomplish this ? Thanks for advice.


var application = require(“application”);
var appSettings = require(“application-settings”);

application.on(application.launchEvent, function (args) {
if (appSettings.getBoolean(‘is_logged’) == true) {
application.start({ moduleName: “auth/auth” });
} else {
application.start({ moduleName: “home/home” });


hey @Konrad, take a look at mentioned links.

this may help you!


Hi kumaran,
Thank you - i will def check those.