[auth] Update auth providers `providerId` to match official SDKs

This commit is contained in:
Chris Bianca 2017-10-16 11:12:40 +01:00
parent 0af5e71b4f
commit 31854bae5b
7 changed files with 14 additions and 14 deletions

View File

@ -1059,13 +1059,13 @@ class RNFirebaseAuth extends ReactContextBaseJavaModule {
*/
private AuthCredential getCredentialForProvider(String provider, String authToken, String authSecret) {
switch (provider) {
case "facebook":
case "facebook.com":
return FacebookAuthProvider.getCredential(authToken);
case "google":
case "google.com":
return GoogleAuthProvider.getCredential(authToken, authSecret);
case "twitter":
case "twitter.com":
return TwitterAuthProvider.getCredential(authToken, authSecret);
case "github":
case "github.com":
return GithubAuthProvider.getCredential(authToken);
case "phone":
return PhoneAuthProvider.getCredential(authToken, authSecret);

View File

@ -100,7 +100,7 @@ Sign in the user with a 3rd party credential provider. `credential` requires the
```javascript
const credential = {
provider: 'facebook',
provider: 'facebook.com',
token: '12345',
secret: '6789',
};
@ -210,7 +210,7 @@ Reauthenticate the current user with credentials:
```javascript
const credentials = {
provider: 'facebook',
provider: 'facebook.com',
token: '12345',
secret: '6789',
};

View File

@ -889,15 +889,15 @@ RCT_EXPORT_METHOD(fetchProvidersForEmail:
- (FIRAuthCredential *)getCredentialForProvider:(NSString *)provider token:(NSString *)authToken secret:(NSString *)authTokenSecret {
FIRAuthCredential *credential;
if ([provider compare:@"twitter" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
if ([provider compare:@"twitter.com" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [FIRTwitterAuthProvider credentialWithToken:authToken secret:authTokenSecret];
} else if ([provider compare:@"facebook" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
} else if ([provider compare:@"facebook.com" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [FIRFacebookAuthProvider credentialWithAccessToken:authToken];
} else if ([provider compare:@"google" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
} else if ([provider compare:@"google.com" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [FIRGoogleAuthProvider credentialWithIDToken:authToken accessToken:authTokenSecret];
} else if ([provider compare:@"password" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [FIREmailAuthProvider credentialWithEmail:authToken password:authTokenSecret];
} else if ([provider compare:@"github" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
} else if ([provider compare:@"github.com" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [FIRGitHubAuthProvider credentialWithToken:authToken];
} else if ([provider compare:@"phone" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
credential = [[FIRPhoneAuthProvider provider] credentialWithVerificationID:authToken verificationCode:authTokenSecret];

View File

@ -1,4 +1,4 @@
const providerId = 'facebook';
const providerId = 'facebook.com';
export default class FacebookAuthProvider {
constructor() {

View File

@ -1,4 +1,4 @@
const providerId = 'github';
const providerId = 'github.com';
export default class GithubAuthProvider {
constructor() {

View File

@ -1,4 +1,4 @@
const providerId = 'google';
const providerId = 'google.com';
export default class GoogleAuthProvider {
constructor() {

View File

@ -1,4 +1,4 @@
const providerId = 'twitter';
const providerId = 'twitter.com';
export default class TwitterAuthProvider {
constructor() {