Meteor.userId() still returns the id on client when logging out and subscriptions restart #1331
Comments
@zhanghaojie I threw the error in the publisher myself, in order to pass the info to the subscriber in the client. That should be quite separate from the log out process though shouldn't it? i.e. it shouldn't break the logout. |
@zhanghaojie Are you trying to tell me that throwing in a publisher breaks loggingOut by design, and this is not a bug? Or are you suggesting what the problem is to help me work around it? |
Sorry!!! Forget my answer , I am wrong. |
Yeah, I can see why having |
I've created PR #8271 to help address this issue (yes, I know, it's been a while ... but better late than never, right? |
PR #8271 has been merged, so |
I've got a publish method that throws an error if the user isn't signed in.
If the user happens to be using the app, then signs out while subscribed to this, the subscription gets restarted as expected, and the publisher throws the 'Not signed in error'
However, the error handler for the subscription, when receiving the error from the publisher, seems to think the user is still signed in. i.e. Meteor.userId() returns the user's ID. At this time, I'd expect Meteor.userId() to return null, recognizing the user has signed out. Or if that's not possible, a Meteor.loggingOut() method to show it's in process.
I can provide a simple reproduction if this isn't obvious.
The text was updated successfully, but these errors were encountered: