javascript - Confused About Meteor this.next() Error onBeforeAction -


i have following code router map:

this.route('confirmtag', {     path: '/confirm-tag',     template: 'confirmtag',     controller: 'signupcontroller',     onbeforeaction: function () {         if (meteor.user()) {             if (typeof user.profile.tag === 'undefined') {                 router.go('confirm');             } else {                 router.go('checkemail');             }             this.next();         } else {             router.go('signup');         }         this.next();     } }); 

yet, keep getting error in console:

exception in callback of async function: .onbeforeaction@http://localhost:3000/lib/router.js?783dc96a24a92cfd09fbf0ca371d762661a830bb:87:9 

line 87 in example code is:

if (typeof user.profile.tag === 'undefined') { 

what or how should "this.next();" placed in above code?

thanks in advance.

i don't see user defined anywhere. ...

this.route('confirmtag', {     path: '/confirm-tag',     template: 'confirmtag',     controller: 'signupcontroller',     onbeforeaction: function () {         if (meteor.user()) {             var user = meteor.user();             if (typeof user.profile.tag === 'undefined') {                 router.go('confirm');             } else {                 router.go('checkemail');             }             this.next();         } else {             router.go('signup');         }         this.next();     } }); 

Comments