-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
After disconnect and reconnect the userId is null in protected #891
Comments
Is this related to Meteor 3.0.3: Fix Meteor.userId only being invoked with bindEnvironment ? |
I'm still using Meteor 2.16 (sorry, forgot to mention that), so I don't think so. Or might that be a problem in 2.x too? |
At Meteor Forums is also other posts about bug where userId is null. I know only about above userId null fix in Meteor 3. I'm currently in progress of migrating to Meteor 3, I have not tested this bug. |
I looked at this problem again and I think it is the same as issue #763 . I tried to understand what's happening. I'm not sure if I understand it completely but this is what I understood: |
First of all thanks for a great library! I'm having an issue that if the app goes offline for a moment and comes back online (can be simulated with
Meteor.disconnect()
andMeteor.reconnect()
), thethis.userId
in the protected method on the server isnull
. I checked that thex_mtok
cookie is set and it's correctly updated to the new session id after the reconnect. I checked in theserver.js
, in the_getUserDefault()
when getting the cookie it gets the old session id for the session that doesn't exist anymore, so it can't find the user. What I would expect is that it returns the new session id so it finds the user. When I refresh the page everything is working again.I'm using ostrio:files version 2.3.3 on Linux in a single server setup. I created a very simple meteor app to reproduce it here: https://github.com/aertms/mfiles
You can login with user
test
and passwordtest
. If you upload an image file when running the small app it shows below. Now if you runMeteor.disconnect()
and thenMeteor.reconnect()
in the browser console the image is not shown anymore, it returns a 401 code. After a refresh it's shown again.I'm not sure if this is a bug or if there is an issue with my implementation. Or is this expected and I need to work around it?
The text was updated successfully, but these errors were encountered: