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

signInWithProvider argument mismatch #282

Open
ThaNarie opened this issue Feb 6, 2017 · 1 comment
Open

signInWithProvider argument mismatch #282

ThaNarie opened this issue Feb 6, 2017 · 1 comment

Comments

@ThaNarie
Copy link

ThaNarie commented Feb 6, 2017

I'm getting an argument mismatch on the signInWithProvider function, expected 4, received 2.
I'm using the v3 branch.

The Java code expects 4 arguments (3 + callback/promise).

public void signInWithProvider(final String provider, final String authToken, final String authSecret, final Callback callback) {

But the JS code sends an object as first argument.

return promisify('signInWithProvider', FirestackAuth)(credential);

The link function seems to be correctly updated:

return promisify('link', FirestackAuth, 'auth/')(credential.provider, credential.token, credential.secret);

Changing the code to this seems to work:

signInWithCredential(credential: any): Promise<Object> {
  return promisify('signInWithProvider', FirestackAuth)(credential.provider, credential.token, credential.secret);
}
@abcd-ca
Copy link

abcd-ca commented Feb 13, 2017

@ThaNarie This fixed it for me too, thanks. It should be accessToken in the JavaScript and in the Java as that's what it is in iOS and Web SDK. I've included this in my pull request (with docs updated for authToken too)

abcd-ca added a commit to abcd-ca/react-native-firestack that referenced this issue Feb 13, 2017
Solution discovered by @TheNarie in [this issue](fullstackreact#282) except I also corrected `accessToken` from the original suggestion. Docs also updated about that in same pull request.
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

No branches or pull requests

2 participants