From 0984f6d680d52f5ae7700a3aed159689d9d827e0 Mon Sep 17 00:00:00 2001 From: Salakar Date: Sun, 24 Sep 2017 13:50:00 +0100 Subject: [PATCH] [auth] constructing an new instance of an auth provider class will now throw an unsupported error --- lib/modules/auth/providers/EmailAuthProvider.js | 10 +++++----- lib/modules/auth/providers/FacebookAuthProvider.js | 10 +++++----- lib/modules/auth/providers/GithubAuthProvider.js | 10 +++++----- lib/modules/auth/providers/GoogleAuthProvider.js | 10 +++++----- lib/modules/auth/providers/PhoneAuthProvider.js | 10 +++++----- lib/modules/auth/providers/TwitterAuthProvider.js | 10 +++++----- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/lib/modules/auth/providers/EmailAuthProvider.js b/lib/modules/auth/providers/EmailAuthProvider.js index 1c64b7ab..1f34ea46 100644 --- a/lib/modules/auth/providers/EmailAuthProvider.js +++ b/lib/modules/auth/providers/EmailAuthProvider.js @@ -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; - } -}; +} diff --git a/lib/modules/auth/providers/FacebookAuthProvider.js b/lib/modules/auth/providers/FacebookAuthProvider.js index 90eff7a7..b74afd50 100644 --- a/lib/modules/auth/providers/FacebookAuthProvider.js +++ b/lib/modules/auth/providers/FacebookAuthProvider.js @@ -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; - } -}; +} diff --git a/lib/modules/auth/providers/GithubAuthProvider.js b/lib/modules/auth/providers/GithubAuthProvider.js index f12294c4..73da9598 100644 --- a/lib/modules/auth/providers/GithubAuthProvider.js +++ b/lib/modules/auth/providers/GithubAuthProvider.js @@ -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; - } -}; +} diff --git a/lib/modules/auth/providers/GoogleAuthProvider.js b/lib/modules/auth/providers/GoogleAuthProvider.js index 27b08580..6dc88ff9 100644 --- a/lib/modules/auth/providers/GoogleAuthProvider.js +++ b/lib/modules/auth/providers/GoogleAuthProvider.js @@ -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; - } -}; +} diff --git a/lib/modules/auth/providers/PhoneAuthProvider.js b/lib/modules/auth/providers/PhoneAuthProvider.js index bd34990e..3d53cbcd 100644 --- a/lib/modules/auth/providers/PhoneAuthProvider.js +++ b/lib/modules/auth/providers/PhoneAuthProvider.js @@ -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; - } -}; +} diff --git a/lib/modules/auth/providers/TwitterAuthProvider.js b/lib/modules/auth/providers/TwitterAuthProvider.js index b10d639a..786eac62 100644 --- a/lib/modules/auth/providers/TwitterAuthProvider.js +++ b/lib/modules/auth/providers/TwitterAuthProvider.js @@ -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; - } -}; +}