Robert Petz
Robert Petz

Reputation: 2764

Ember transition retry with query params

So I have application authentication logic in my ember app. When the user hits a route that they need to be authenticated to enter, they are transitioned to the Login route and the original route they wanted to hit is saved. When they login, I check to see if there was an original route to transition back to and send them back to that at that point.

This works fine, except when there are query params in the original route. The transition should send them to '#/OldRoute/3' (for example), but instead it sends them to '#/OldRoute/undefined'

How can I retry a transition while maintaining the query params?

Upvotes: 0

Views: 480

Answers (1)

Deewendra Shrestha
Deewendra Shrestha

Reputation: 2465

I think you would need proper model to redirect to nested route, so lets see, may be you can save the route and the parameter(X) too. Once you have authenticated the user, you might want to fetch the model(ticket model with id X) from the store based on the route name (original route) and then only do transition with the fetched model passed as parameter to transitionToRoute function.

Upvotes: 1

Related Questions