-
-
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
Fix for JS SDK needing a key #680
Conversation
@@ -80,7 +80,7 @@ function ParseServer({ | |||
cloud, | |||
collectionPrefix = '', | |||
clientKey = '', | |||
javascriptKey = randomString(20), | |||
javascriptKey = '', |
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.
why not 'unused' there?
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.
because if the server believes it has any client-type key set, every request to the server requires a valid client key (js, client, dotnet, rest).
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.
it's still set to '' we don't check for key lengths. I'll test that in the test repo
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.
And it doesn't fix...
@@ -92,7 +92,7 @@ function ParseServer({ | |||
}) { | |||
|
|||
// Initialize the node client SDK automatically | |||
Parse.initialize(appId, javascriptKey, masterKey); | |||
Parse.initialize(appId, javascriptKey || 'unused', masterKey); |
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.
javascript key is never undefined here as it's defaulted to ''
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.
ok, how about now, with the defaults removed...
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.
That should do, but not sure why @drew-gross added the default strings there?
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.
That was just me mimicking the previous behaviour when updating this function to ES6 style
@gfosco updated the pull request. |
@gfosco that will reintroduce the bug. if any key is set... |
Alternative to #652. This doesn't cause client keys to be required on all requests.