Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ public void onComplete(@NonNull Task<AuthResult> task) {

@ReactMethod
public void signInWithProvider(final String provider, final String authToken, final String authSecret, final Callback callback) {
if (provider.equals("facebook")) {
if (provider.equals("facebook.com")) {
this.facebookLogin(authToken, callback);
} else if (provider.equals("google")) {
} else if (provider.equals("google.com")) {
this.googleLogin(authToken, callback);
} else
// TODO
Expand Down
6 changes: 3 additions & 3 deletions docs/api/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ Sign in the user with a 3rd party credential provider. `credential` requires the

```javascript
const credential = {
provider: 'facebook',
token: '12345',
secret: '6789',
provider: 'facebook.com',
accessToken: '12345',
//secret: '6789', //'secret' does not apply to facebook authentication
};

firestack.auth().signInWithCredential(credential)
Expand Down
7 changes: 6 additions & 1 deletion lib/modules/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ export default class Auth extends Base {
* @return {Promise} A promise resolved upon completion
*/
signInWithCredential(credential: any): Promise<Object> {
return promisify('signInWithProvider', FirestackAuth)(credential);
signInWithCredential(credential: any): Promise<Object> {
Copy link

Choose a reason for hiding this comment

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

@abcd-ca This line is duplicated.

if (Platform.OS === 'ios'){
return promisify('signInWithProvider', FirestackAuth)(credential);
}else{ //Android
return promisify('signInWithProvider', FirestackAuth)(credential.provider, credential.accessToken, credential.secret);
}
}

/**
Expand Down