Notum enables you to have protected / public routes in your application. If you wish to disable protection on a route, please check Public routes
bower install notum
var requirejs = {
"paths": {
"Notum" : "bower_components/notum/src",
"underscore" : "bower_components/underscore/underscore"
}
};
var Backbone = require('backbone');
var Notum = require('Notum/Notum');
var unauthorized = function () {
logger.info('Unauthorized')
app.execute('navigate:login');
};
var notum = new Notum({
backbone : Backbone,
callback : unauthorized,
authorized : false
});
notum.wrap(); //Needs to be called before you create your routers
if (!notum.resume()) {
app.execute('navigate:home');
}
var Router = Marionette.AppRouter.extend({
isProtected : false,
appRoutes: {
'home' : 'index'
}
});