-
-
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
Error occurring using beforeLogin for users logging in with AuthData #6871
Comments
Thanks for reporting and the detailed analysis. You even already submitted a PR, way to go! 🚀 |
I am closing this as it seems to be resolved by #6872. Feel free to comment if you have any questions and we can re-open this issue. |
I'm using
This only happen on |
@alann-maulana A failing test would help to proof that this (or a similar) issue still exists; could you open a new issue and submit a PR with a failing test? |
@mtrezza Ok, I will set it up. Thanks |
this seems to be happening if the following file, if used in any parse object, fails with the above error. new Parse.File('test', {uri: 'URL that redirects to final url'}) If the URI doesn't redirect and it's the final url, then it works Seems File download logic is not following redirects? |
Thanks for opening this issue!
|
Could you submit a PR with a failing test? Please also take a took at #6872 which has a test.ñ for this issue. What is different in the test vs. your scenario? |
Issue Description
When logging in with
AuthData
, an error (similar to #5998) occurs if that user has one or more files associated.If no files associated,
beforeLogin
can be executed without error.Steps to reproduce
beforeLogin
trigger like the following:isBanned
set to true, the following error occurs.Actual Outcome
I spent some time investigating this problem and found that this error was triggered by this block of code:
parse-server/src/triggers.js
Lines 749 to 764 in 44015c3
Specifically, when encoding a file object with
toJSON()
, because the object was not expanded, it has nourl
property and hence cause this block of code to throw an error:Similar to the fix introduced previously (#6001), all we need is to expand file objects before passing them to the trigger
runBeforeLoginTrigger
inRestWrite.js
:Environment
Server
4.3.0
Windows
local
Client
JavaScript
2.15.0
The text was updated successfully, but these errors were encountered: