meteor-angular2-accounts-material-ui
Version:
Material accounts UI for angular2 and meteor
20 lines (19 loc) • 487 B
JavaScript
var meteor_1 = require('meteor/meteor');
/**
* A service to use as auth guard on the route.
*
*/
var AuthGuard = (function () {
function AuthGuard(router) {
this.router = router;
}
AuthGuard.prototype.canActivate = function () {
if (!meteor_1.Meteor.user()) {
this.router.navigate(['/login']);
}
return !!meteor_1.Meteor.user();
};
return AuthGuard;
}());
exports.AuthGuard = AuthGuard;
;