[auth] constructing an new instance of an auth provider class will now throw an unsupported error

This commit is contained in:
Salakar 2017-09-24 13:50:00 +01:00
parent 0f1801c825
commit 0984f6d680
6 changed files with 30 additions and 30 deletions

View File

@ -1,6 +1,10 @@
const providerId = 'password';
export default class EmailAuthProvider {
constructor() {
throw new Error('`new EmailAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class EmailAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}

View File

@ -1,6 +1,10 @@
const providerId = 'facebook';
export default class FacebookAuthProvider {
constructor() {
throw new Error('`new FacebookAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class FacebookAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}

View File

@ -1,6 +1,10 @@
const providerId = 'github';
export default class GithubAuthProvider {
constructor() {
throw new Error('`new GithubAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class GithubAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}

View File

@ -1,6 +1,10 @@
const providerId = 'google';
export default class GoogleAuthProvider {
constructor() {
throw new Error('`new GoogleAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class GoogleAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}

View File

@ -1,6 +1,10 @@
const providerId = 'phone';
export default class PhoneAuthProvider {
constructor() {
throw new Error('`new PhoneAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class PhoneAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}

View File

@ -1,6 +1,10 @@
const providerId = 'twitter';
export default class TwitterAuthProvider {
constructor() {
throw new Error('`new TwitterAuthProvider()` is not supported on react-native-firebase.');
}
static get PROVIDER_ID() {
return providerId;
}
@ -12,8 +16,4 @@ export default class TwitterAuthProvider {
providerId,
};
}
get providerId() {
return providerId;
}
};
}