Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using reactive value in middlewares #37

Closed
delgermurun opened this issue Mar 17, 2015 · 2 comments
Closed

Using reactive value in middlewares #37

delgermurun opened this issue Mar 17, 2015 · 2 comments

Comments

@delgermurun
Copy link
Contributor

I have login required middleware something like it:

function requiredLogin(path, next) {
  var redirectPath = (!Meteor.userId())? "/sign-in" : null;
  next(redirectPath);
}

Since Meteor.userId() reactive, when I go to login required router, redirected to /sign-in. Even when I logged in. How did you solve this kind of issue? Do I have to use fast-render?

It's annoying especially in development. Because on every hot code push reload, it redirects to sign-in.

@arunoda
Copy link
Contributor

arunoda commented Mar 17, 2015

Yes. We handle this using fast-render. I can't imagine some other ways to do this in the route level.

@delgermurun
Copy link
Contributor Author

Okay. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants