Ok, first, I'm going to assume that you did not use a plugin like super, so let me suggest it: https://github.com/lukasolson/Backbone-Super
We want super to communicate with the parent view. Said that, do something like this: (for simplicity I would not use define)
/*
Whatever is your process for login, it should inject
this object with a true flag when logged
*/
var CredentialsCollector = {
logged : false
};
var AppView = Backbone.View.extend({
requireLogin: true,
render : function(){
if( requireLogin && !CredentialsCollector.logged ){
//do a redirect to your login module
}
}
});
var SomeView = AppView .extend({
render : function(){
/*
this call the parent render to check the login; if required and not
logged it automatically make the redirection
*/
this._super();
//<- here do your normal render stuff
}
});