-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Clear the session-user cache when changing _User objects #1072
Conversation
Current coverage is
|
@@ -341,6 +341,11 @@ RestWrite.prototype.transformUser = function() { | |||
}); | |||
} | |||
|
|||
// If we're updating a _User object, clear the user cache for the session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also when we have the oauthLogin shortcut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean here..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean when we do the login shortcut with oAuth, we go through that method. If there is a cached token for the found user, we should destroy it too to remove any wrong possible state, the same way we remove it upon user login
Thanks @gfosco ! Does it also solve for the following case where we have a user with a pointer to a second object (privateData)?
Will there be an old version of the "privateData" object tagging along with the cardDetails? |
I don't think it would solve that case, no. I think you should perform a fetch on any included objects. Since we store the user cache based on sessionToken, it also wouldn't support changes to that user made by the masterKey. We'd have to search through all the sessions to invalidate any matching that user... |
Clear the session-user cache when changing _User objects
For issue #1062