Skip to content

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.

src/index.js Outdated
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...


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

5 participants