-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Old bug still here: unwanted authData validation #6228
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
Comments
Probably on the server side. Can you write a test case? |
I don't see how, there's no test for this very internal process so I don't know how I would write it... |
@SebC99 What does your authData look like in mongo? Mine is a string and it returns as a string when I query or debug RestWrite.js
|
@dplewis for most users, it's the same as yours, but for others (old ones) it's a date:
|
There are 2 solutions for this
Which do you prefer? Your problem will be immediately solve with option 1. Option 2 is for this specific use case. Open a PR we are more than welcome to review it. Closing as this is an old issue. |
I've patched the RestWrite, adding an equality method in Auth Adapters, but you're right, a script might be safer ;) |
I found this problem with my custom auth. Every time that I update the user object, auth data validation is triggered. |
This bug #3867 is still here even with #3783 and #3872 fixes.
The reason why is in the RestWrite.js file:
When tested with facebook, the userAuthData comes from the saved user (MongoDB in my case), and it includes a token and an expiration date which is a Date object.
But the providerData which comes from the rest request from the SDK includes the same token and expiration date, but the expiration date is a string in that case. So we don't have equality of object.
There should be a conversion somewhere, but what's the best place to do it?
The text was updated successfully, but these errors were encountered: