Closed madhan5000 closed 8 years ago
You're right!
It seems that the previous path always take precedence and the execution passes through this line even when you configure homeRoutePath
.
I'll have a better look at this asap.
@madhan5000 I've had a better look at this.
The only case where homeRoutePath
gets used is when you directly head to, e.g. http://your.app/signIn
and your old session is resumed (i.e. you're already logged in...).
In this case there's no previousPath
and the client is redirected to homeRoutePath
.
In case you're trying to force a redirect after a regular sign in, you can set the redirect
field while configuring the signIn
route:
AccountsTemplates.configureRoute(`signIn`, {
redirect: `routeName or route path of function`
});
In any case the documentation needs to be corrected.
Also the redirect
option for routes should be documented for AccountsTemplates.configureRoute
in the flow-routing
package which is currently missing.
See here for the relevant code and here for the corresponding section for the iron-routing
.
cc: @jshimko
@madhan5000 AccountsTemplates.ensureSignedIn
in any case should redirect you back to your /plans
route after a successful login...
@splendido Thanks for getting back to me. Yes, I agree clear documentation would definitely help for those who don't have any iron-router experience. Thanks again.
then maybe finally accept my PR ? Or tell me or to ameliorate it, because I would like my work to prevent new user to waste as many times as me :) EDIT : oh okay sorry madhan, I hope @splendido will take a look at my PR then
@NitroBAY I am not the original author or a contributor. Please contact @splendido
Hello authors, it looks like homeRoutePath has no effect? I want to redirect after sign-in. It gets redirected back to '/' route.
here is my config. I using Meteor 1.2
});
my route
Thanks for your help!
Code in Question : https://github.com/meteor-useraccounts/flow-routing/blob/master/lib/client/client.js#L142
the line above fails with my configuration.