meteor-useraccounts / flow-routing

Useraccounts packages add-on for integration with Flow Router and Blaze Layout.
https://atmospherejs.com/useraccounts/flow-routing
MIT License
72 stars 50 forks source link

Router jumps to home page if login dialog is used in a modal #12

Closed derwaldgeist closed 9 years ago

derwaldgeist commented 9 years ago

I am using the approach of @maxhodges to use the login dialog in a modal dialog, like explained here: https://github.com/meteor-useraccounts/bootstrap/issues/25

Yet, every time the user logs in, flow router automatically jumps to the home page of my application instead of staying on the current page. It does not behave this way if I am using the standard full-page login dialog, so my flow router configuration seems to be correct and it must have something to do with the useraccounts package itself (either core or flowrouting).

Maxhodges commented 9 years ago

i think you can set that

see "homeRoutePath" in le guide

https://github.com/meteor-useraccounts/core/blob/master/Guide.md

splendido commented 9 years ago

For useraccounts:iron-routing it's enough to set AccountsTemplates.avoidRedirect to true to solve this issue: see this line

At the moment that's not the same for useraccounts:flow-routing: see this line I see there's an avoidDefaultRefirect here and here but actually it's never initialized...

@jshimko do you have any memory about this change we had during the split of routing stuff?

Should we rename avoidDefaultRedirect back to avoidRedirect (which is initialized here btw...) and modify the link click to be alike the one we have for IR?

derwaldgeist commented 9 years ago

Thanks for taking action on this, highly appreciated!

jshimko commented 9 years ago

@splendido @derwaldgeist Yeah, I guess that one just flew under the radar when we were making the conversion. I'll take a closer look and see if I can get it sorted out.

derwaldgeist commented 9 years ago

Thanks for picking this up!

splendido commented 9 years ago

This should be solved now, thanks @jshimko!

derwaldgeist commented 9 years ago

Oh, great, will have a look at it! Thanks.