Today I updated iron:router from 0.9.4 to the newest version. I can’t imagine this is caused by iron router but since then, when I call Meteor.loginWithPassword, even if it’s just Meteor.loginWithPassword('', '') from the console, I get redirected from /login to /. I have no idea why this could happen. I don’t get any logs in the console, just server-side logs telling me the login has failed.
I am actually having a similar issue. Meteor.loginWithPassword() some how triggers a route to ‘/’. I can see this happening because I have a Iron Router global Router.onBeforeAction being triggered regardless of whether the login succeeds of fails. @fvg did you ever figure this out?
@fvg@borges Hey guys. I actually ended up figuring it out for my app. Hopefully my issue will help solve yours. So in my Iron Router code, I have a typical global Router.onBeforeAction hook that checked on all route changes if a user was logged in. My issue was that I was also checking while a user was loggingIn as well. The below change fixed the redirect that was happening.