Skip to content
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

Merged
merged 1 commit into from
Feb 26, 2016
Merged

Fix for JS SDK needing a key #680

merged 1 commit into from
Feb 26, 2016

Conversation

gfosco
Copy link
Contributor

@gfosco gfosco commented Feb 26, 2016

Alternative to #652. This doesn't cause client keys to be required on all requests.

@@ -80,7 +80,7 @@ function ParseServer({
cloud,
collectionPrefix = '',
clientKey = '',
javascriptKey = randomString(20),
javascriptKey = '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 'unused' there?

Copy link
Contributor Author

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).

Copy link
Contributor

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

Copy link
Contributor

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);
Copy link
Contributor

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 ''

Copy link
Contributor Author

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...

Copy link
Contributor

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?

Copy link
Contributor

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

@facebook-github-bot
Copy link

@gfosco updated the pull request.

gfosco added a commit that referenced this pull request Feb 26, 2016
@gfosco gfosco merged commit 57c9364 into master Feb 26, 2016
@gfosco gfosco deleted the fosco.jssdk branch February 26, 2016 14:48
@flovilmart
Copy link
Contributor

@gfosco that will reintroduce the bug. if any key is set...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants