Open garrilla opened 10 years ago
I am also having this problem, but it appears to be in the coming from the onBeforeAction of my route. Stack on the client is:
Exception in defer callback: TypeError: Cannot read property 'call' of undefined at Object.AccountsEntry.signInRequired (http://localhost:3000/packages/joshowens:accounts-entry.js?f7e4d669676cae372c56343c0fe6547061be6257:97:21) at route.onBeforeAction (http://localhost:3000/routes.js?4370f03a4b11f72ee9334b8365abf1090d95834e:50:52) at RouteController.runHooks (http://localhost:3000/packages/iron:router.js?6b18ea50d8f8d2ce59b5781394220f6cb28cfe09:843:16) at http://localhost:3000/packages/iron:router.js?6b18ea50d8f8d2ce59b5781394220f6cb28cfe09:2299:14 at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36) at new Tracker.Computation (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:206:10) at Object.Tracker.autorun (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:476:11) at http://localhost:3000/packages/iron:router.js?6b18ea50d8f8d2ce59b5781394220f6cb28cfe09:2276:12 at http://localhost:3000/packages/iron:router.js?6b18ea50d8f8d2ce59b5781394220f6cb28cfe09:2248:21 at Tracker.Computation._compute (http://localhost:3000/packages/tracker.js?192a05cc46b867dadbe8bf90dd961f6f8fd1574f:288:36) debug.js:41
My route is defined as: this.route('admin', { path: '/admin', onBeforeAction: function() { AccountsEntry.signInRequired(this); } });
The result of going to /admin is that I get routed to /sign-in, but I get no "Sign In" button. Typing in the username/password and hitting enter does nothing (or at least seems to).
I am running Meteor 0.9.1.1, using only accounts-password and accounts-entry (plus whatever gets pulled in via dependencies on those packages).
Ok, so I got passed this problem. Basically, I change the route to look like this:
this.route('dashboard', { path: '/dashboard', onBeforeAction: function(pause) { AccountsEntry.signInRequired(this, pause); } });
Notice the onBeforeAction call, passing 'pause' as an option to the function, then passing it to AccountsEntry.signInRequired().
Still having an issue with long, though. Keep getting ">Login forbidden<" when I try to login, but this is for another bug...
Thanks @mbabauer that fix worked for me, was having similar issues.
I have a simple template
if not logged in it shows the login buttons, but also produces this error
Any advice or a fix?