@firebase/auth 0.19.2 → 0.19.3-canary.ce39a1a07
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/auth-public.d.ts +9 -10
- package/dist/auth.d.ts +9 -10
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/index.rn.d.ts +2 -0
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-c9a90ba6.js → popup_redirect-cccc2cf0.js} +10 -10
- package/dist/cordova/popup_redirect-cccc2cf0.js.map +1 -0
- package/dist/cordova/src/core/providers/facebook.d.ts +2 -2
- package/dist/cordova/src/core/providers/github.d.ts +2 -2
- package/dist/cordova/src/core/providers/google.d.ts +2 -2
- package/dist/cordova/src/core/providers/twitter.d.ts +2 -2
- package/dist/cordova/src/model/public_types.d.ts +1 -2
- package/dist/cordova/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/esm2017/{index-aa9a64ed.js → index-c35b9425.js} +10 -10
- package/dist/esm2017/index-c35b9425.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/index.rn.d.ts +2 -0
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/core/providers/facebook.d.ts +2 -2
- package/dist/esm2017/src/core/providers/github.d.ts +2 -2
- package/dist/esm2017/src/core/providers/google.d.ts +2 -2
- package/dist/esm2017/src/core/providers/twitter.d.ts +2 -2
- package/dist/esm2017/src/model/public_types.d.ts +1 -2
- package/dist/esm2017/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/esm5/{index-258b887f.js → index-cbc86e16.js} +10 -10
- package/dist/esm5/index-cbc86e16.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/index.rn.d.ts +2 -0
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/core/providers/facebook.d.ts +2 -2
- package/dist/esm5/src/core/providers/github.d.ts +2 -2
- package/dist/esm5/src/core/providers/google.d.ts +2 -2
- package/dist/esm5/src/core/providers/twitter.d.ts +2 -2
- package/dist/esm5/src/model/public_types.d.ts +1 -2
- package/dist/esm5/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/index.rn.d.ts +2 -0
- package/dist/index.webworker.esm5.js +9 -9
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-c31cd336.js → index-1128f950.js} +10 -10
- package/dist/node/{index-c31cd336.js.map → index-1128f950.js.map} +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.rn.d.ts +2 -0
- package/dist/node/internal.js +1 -1
- package/dist/node/src/core/providers/facebook.d.ts +2 -2
- package/dist/node/src/core/providers/github.d.ts +2 -2
- package/dist/node/src/core/providers/google.d.ts +2 -2
- package/dist/node/src/core/providers/twitter.d.ts +2 -2
- package/dist/node/src/model/public_types.d.ts +1 -2
- package/dist/node/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/node-esm/{index-8ad4aaf6.js → index-aea87009.js} +10 -10
- package/dist/node-esm/{index-8ad4aaf6.js.map → index-aea87009.js.map} +1 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/index.rn.d.ts +2 -0
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/src/core/providers/facebook.d.ts +2 -2
- package/dist/node-esm/src/core/providers/github.d.ts +2 -2
- package/dist/node-esm/src/core/providers/google.d.ts +2 -2
- package/dist/node-esm/src/core/providers/twitter.d.ts +2 -2
- package/dist/node-esm/src/model/public_types.d.ts +1 -2
- package/dist/node-esm/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/rn/index.js +12 -11
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/index.rn.d.ts +2 -0
- package/dist/rn/internal.js +1 -1
- package/dist/rn/{phone-92c70916.js → phone-9c91b099.js} +10 -10
- package/dist/rn/phone-9c91b099.js.map +1 -0
- package/dist/rn/src/core/providers/facebook.d.ts +2 -2
- package/dist/rn/src/core/providers/github.d.ts +2 -2
- package/dist/rn/src/core/providers/google.d.ts +2 -2
- package/dist/rn/src/core/providers/twitter.d.ts +2 -2
- package/dist/rn/src/model/public_types.d.ts +1 -2
- package/dist/rn/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/dist/src/core/providers/facebook.d.ts +2 -2
- package/dist/src/core/providers/github.d.ts +2 -2
- package/dist/src/core/providers/google.d.ts +2 -2
- package/dist/src/core/providers/twitter.d.ts +2 -2
- package/dist/src/model/public_types.d.ts +1 -2
- package/dist/src/platform_react_native/persistence/react_native.d.ts +4 -10
- package/package.json +6 -6
- package/dist/cordova/popup_redirect-c9a90ba6.js.map +0 -1
- package/dist/esm2017/index-aa9a64ed.js.map +0 -1
- package/dist/esm5/index-258b887f.js.map +0 -1
- package/dist/rn/phone-92c70916.js.map +0 -1
package/dist/node-esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-
|
|
1
|
+
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-aea87009.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import 'tslib';
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { FirebaseApp } from '@firebase/app';
|
|
18
18
|
import { Auth, Persistence } from './src/model/public_types';
|
|
19
|
+
import { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';
|
|
19
20
|
export * from './index.shared';
|
|
20
21
|
export { PhoneAuthProvider } from './src/platform_browser/providers/phone';
|
|
21
22
|
export { signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber } from './src/platform_browser/strategies/phone';
|
|
@@ -27,4 +28,5 @@ export { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions
|
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
export declare const reactNativeLocalPersistence: Persistence;
|
|
31
|
+
export { getReactNativePersistence };
|
|
30
32
|
export declare function getAuth(app?: FirebaseApp): Auth;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ao as _getInstance, ap as _assert, aq as _signInWithCredential, ar as _reauthenticate, as as _link$1, G as AuthCredential, at as signInWithIdp, au as _fail, av as debugAssert, aw as _persistenceKeyName, ax as _castAuth, ay as FederatedAuthProvider, az as BaseOAuthProvider, aA as _emulatorUrl, aB as _performApiRequest, aC as _isIOS7Or8, aD as _isIOS, aE as _isAndroid, aF as _createError, aG as _isSafari, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10 } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aL as AuthImpl, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aN as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aK as UserImpl, ap as _assert, ax as _castAuth, au as _fail, aM as _getClientVersion, ao as _getInstance, aw as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-
|
|
1
|
+
import { ao as _getInstance, ap as _assert, aq as _signInWithCredential, ar as _reauthenticate, as as _link$1, G as AuthCredential, at as signInWithIdp, au as _fail, av as debugAssert, aw as _persistenceKeyName, ax as _castAuth, ay as FederatedAuthProvider, az as BaseOAuthProvider, aA as _emulatorUrl, aB as _performApiRequest, aC as _isIOS7Or8, aD as _isIOS, aE as _isAndroid, aF as _createError, aG as _isSafari, aH as _isIframe, aI as _isMobileBrowser, aJ as _isIE10 } from './index-aea87009.js';
|
|
2
|
+
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aL as AuthImpl, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aN as FetchProvider, Q as GithubAuthProvider, N as GoogleAuthProvider, I as OAuthCredential, T as OAuthProvider, O as OperationType, J as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, o as ProviderId, R as RecaptchaVerifier, aO as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aK as UserImpl, ap as _assert, ax as _castAuth, au as _fail, aM as _getClientVersion, ao as _getInstance, aw as _persistenceKeyName, a1 as applyActionCode, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a2 as checkActionCode, a0 as confirmPasswordReset, E as connectAuthEmulator, a4 as createUserWithEmailAndPassword, z as debugErrorMap, y as deleteUser, a9 as fetchSignInMethodsForEmail, ak as getAdditionalUserInfo, n as getAuth, ah as getIdToken, ai as getIdTokenResult, am as getMultiFactorResolver, j as getRedirectResult, K as inMemoryPersistence, i as indexedDBLocalPersistence, D as initializeAuth, a7 as isSignInWithEmailLink, Y as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, an as multiFactor, t as onAuthStateChanged, q as onIdTokenChanged, ad as parseActionCodeURL, B as prodErrorMap, Z as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, al as reload, aa as sendEmailVerification, $ as sendPasswordResetEmail, a6 as sendSignInLinkToEmail, p as setPersistence, W as signInAnonymously, X as signInWithCredential, _ as signInWithCustomToken, a5 as signInWithEmailAndPassword, a8 as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, x as signOut, aj as unlink, w as updateCurrentUser, af as updateEmail, ag as updatePassword, u as updatePhoneNumber, ae as updateProfile, v as useDeviceLanguage, ab as verifyBeforeUpdateEmail, a3 as verifyPasswordResetCode } from './index-aea87009.js';
|
|
3
3
|
import { querystring, isEmpty, getUA, querystringDecode } from '@firebase/util';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import { SDK_VERSION } from '@firebase/app';
|
|
@@ -36,7 +36,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
36
36
|
* // This is the signed-in user
|
|
37
37
|
* const user = result.user;
|
|
38
38
|
* // This gives you a Facebook Access Token.
|
|
39
|
-
* const credential =
|
|
39
|
+
* const credential = FacebookAuthProvider.credentialFromResult(result);
|
|
40
40
|
* const token = credential.accessToken;
|
|
41
41
|
* }
|
|
42
42
|
* ```
|
|
@@ -51,7 +51,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
51
51
|
* // The signed-in user info.
|
|
52
52
|
* const user = result.user;
|
|
53
53
|
* // This gives you a Facebook Access Token.
|
|
54
|
-
* const credential =
|
|
54
|
+
* const credential = FacebookAuthProvider.credentialFromResult(result);
|
|
55
55
|
* const token = credential.accessToken;
|
|
56
56
|
* ```
|
|
57
57
|
*
|
|
@@ -40,7 +40,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
40
40
|
* // This is the signed-in user
|
|
41
41
|
* const user = result.user;
|
|
42
42
|
* // This gives you a Github Access Token.
|
|
43
|
-
* const credential =
|
|
43
|
+
* const credential = GithubAuthProvider.credentialFromResult(result);
|
|
44
44
|
* const token = credential.accessToken;
|
|
45
45
|
* }
|
|
46
46
|
* ```
|
|
@@ -55,7 +55,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
55
55
|
* // The signed-in user info.
|
|
56
56
|
* const user = result.user;
|
|
57
57
|
* // This gives you a Github Access Token.
|
|
58
|
-
* const credential =
|
|
58
|
+
* const credential = GithubAuthProvider.credentialFromResult(result);
|
|
59
59
|
* const token = credential.accessToken;
|
|
60
60
|
* ```
|
|
61
61
|
* @public
|
|
@@ -37,7 +37,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
37
37
|
* // This is the signed-in user
|
|
38
38
|
* const user = result.user;
|
|
39
39
|
* // This gives you a Google Access Token.
|
|
40
|
-
* const credential =
|
|
40
|
+
* const credential = GoogleAuthProvider.credentialFromResult(result);
|
|
41
41
|
* const token = credential.accessToken;
|
|
42
42
|
* }
|
|
43
43
|
* ```
|
|
@@ -53,7 +53,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
53
53
|
* // The signed-in user info.
|
|
54
54
|
* const user = result.user;
|
|
55
55
|
* // This gives you a Google Access Token.
|
|
56
|
-
* const credential =
|
|
56
|
+
* const credential = GoogleAuthProvider.credentialFromResult(result);
|
|
57
57
|
* const token = credential.accessToken;
|
|
58
58
|
* ```
|
|
59
59
|
*
|
|
@@ -51,7 +51,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
51
51
|
* // This is the signed-in user
|
|
52
52
|
* const user = result.user;
|
|
53
53
|
* // This gives you a Twitter Access Token and Secret.
|
|
54
|
-
* const credential =
|
|
54
|
+
* const credential = TwitterAuthProvider.credentialFromResult(result);
|
|
55
55
|
* const token = credential.accessToken;
|
|
56
56
|
* const secret = credential.secret;
|
|
57
57
|
* }
|
|
@@ -66,7 +66,7 @@ import { BaseOAuthProvider } from './oauth';
|
|
|
66
66
|
* // The signed-in user info.
|
|
67
67
|
* const user = result.user;
|
|
68
68
|
* // This gives you a Twitter Access Token and Secret.
|
|
69
|
-
* const credential =
|
|
69
|
+
* const credential = TwitterAuthProvider.credentialFromResult(result);
|
|
70
70
|
* const token = credential.accessToken;
|
|
71
71
|
* const secret = credential.secret;
|
|
72
72
|
* ```
|
|
@@ -934,8 +934,7 @@ export interface User extends UserInfo {
|
|
|
934
934
|
toJSON(): object;
|
|
935
935
|
}
|
|
936
936
|
/**
|
|
937
|
-
* A structure containing a {@link User},
|
|
938
|
-
* and any additional user information that was returned from the identity provider.
|
|
937
|
+
* A structure containing a {@link User}, the {@link OperationType}, and the provider ID.
|
|
939
938
|
*
|
|
940
939
|
* @remarks
|
|
941
940
|
* `operationType` could be {@link OperationType}.SIGN_IN for a sign-in operation,
|
|
@@ -16,16 +16,10 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';
|
|
18
18
|
/**
|
|
19
|
-
* Returns a persistence
|
|
20
|
-
* `react-native` or `@react-native-community/async-storage
|
|
19
|
+
* Returns a persistence object that wraps AsyncStorage imported from
|
|
20
|
+
* `react-native` or `@react-native-community/async-storage`, and can
|
|
21
|
+
* be used in the persistence dependency field in {@link initializeAuth}.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* In the _getInstance() implementation (see src/core/persistence/index.ts),
|
|
25
|
-
* we expect each "externs.Persistence" object passed to us by the user to
|
|
26
|
-
* be able to be instantiated (as a class) using "new". That function also
|
|
27
|
-
* expects the constructor to be empty. Since ReactNativeStorage requires the
|
|
28
|
-
* underlying storage layer, we need to be able to create subclasses
|
|
29
|
-
* (closures, esentially) that have the storage layer but empty constructor.
|
|
23
|
+
* @public
|
|
30
24
|
*/
|
|
31
25
|
export declare function getReactNativePersistence(storage: ReactNativeAsyncStorage): Persistence;
|
package/dist/rn/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var reactNative = require('react-native');
|
|
6
6
|
var app = require('@firebase/app');
|
|
7
|
-
var phone = require('./phone-
|
|
7
|
+
var phone = require('./phone-9c91b099.js');
|
|
8
8
|
var tslib = require('tslib');
|
|
9
9
|
require('@firebase/util');
|
|
10
10
|
require('@firebase/component');
|
|
@@ -27,20 +27,20 @@ require('@firebase/logger');
|
|
|
27
27
|
* limitations under the License.
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
* Returns a persistence
|
|
31
|
-
* `react-native` or `@react-native-community/async-storage
|
|
30
|
+
* Returns a persistence object that wraps AsyncStorage imported from
|
|
31
|
+
* `react-native` or `@react-native-community/async-storage`, and can
|
|
32
|
+
* be used in the persistence dependency field in {@link initializeAuth}.
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* In the _getInstance() implementation (see src/core/persistence/index.ts),
|
|
36
|
-
* we expect each "externs.Persistence" object passed to us by the user to
|
|
37
|
-
* be able to be instantiated (as a class) using "new". That function also
|
|
38
|
-
* expects the constructor to be empty. Since ReactNativeStorage requires the
|
|
39
|
-
* underlying storage layer, we need to be able to create subclasses
|
|
40
|
-
* (closures, esentially) that have the storage layer but empty constructor.
|
|
34
|
+
* @public
|
|
41
35
|
*/
|
|
42
36
|
function getReactNativePersistence(storage) {
|
|
43
37
|
var _a;
|
|
38
|
+
// In the _getInstance() implementation (see src/core/persistence/index.ts),
|
|
39
|
+
// we expect each "externs.Persistence" object passed to us by the user to
|
|
40
|
+
// be able to be instantiated (as a class) using "new". That function also
|
|
41
|
+
// expects the constructor to be empty. Since ReactNativeStorage requires the
|
|
42
|
+
// underlying storage layer, we need to be able to create subclasses
|
|
43
|
+
// (closures, esentially) that have the storage layer but empty constructor.
|
|
44
44
|
return _a = /** @class */ (function () {
|
|
45
45
|
function class_1() {
|
|
46
46
|
this.type = "LOCAL" /* LOCAL */;
|
|
@@ -203,5 +203,6 @@ exports.useDeviceLanguage = phone.useDeviceLanguage;
|
|
|
203
203
|
exports.verifyBeforeUpdateEmail = phone.verifyBeforeUpdateEmail;
|
|
204
204
|
exports.verifyPasswordResetCode = phone.verifyPasswordResetCode;
|
|
205
205
|
exports.getAuth = getAuth;
|
|
206
|
+
exports.getReactNativePersistence = getReactNativePersistence;
|
|
206
207
|
exports.reactNativeLocalPersistence = reactNativeLocalPersistence;
|
|
207
208
|
//# sourceMappingURL=index.js.map
|
package/dist/rn/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/platform_react_native/persistence/react_native.ts","../../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';\n\nimport {\n PersistenceInternal,\n PersistenceType,\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n StorageEventListener\n} from '../../core/persistence';\n\n/**\n * Returns a persistence
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/platform_react_native/persistence/react_native.ts","../../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';\n\nimport {\n PersistenceInternal,\n PersistenceType,\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n StorageEventListener\n} from '../../core/persistence';\n\n/**\n * Returns a persistence object that wraps AsyncStorage imported from\n * `react-native` or `@react-native-community/async-storage`, and can\n * be used in the persistence dependency field in {@link initializeAuth}.\n * \n * @public\n */\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\n // In the _getInstance() implementation (see src/core/persistence/index.ts),\n // we expect each \"externs.Persistence\" object passed to us by the user to\n // be able to be instantiated (as a class) using \"new\". That function also\n // expects the constructor to be empty. Since ReactNativeStorage requires the\n // underlying storage layer, we need to be able to create subclasses\n // (closures, esentially) that have the storage layer but empty constructor.\n return class implements PersistenceInternal {\n static type: 'LOCAL' = 'LOCAL';\n readonly type: PersistenceType = PersistenceType.LOCAL;\n\n async _isAvailable(): Promise<boolean> {\n try {\n if (!storage) {\n return false;\n }\n await storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n await storage.removeItem(STORAGE_AVAILABLE_KEY);\n return true;\n } catch {\n return false;\n }\n }\n\n _set(key: string, value: PersistenceValue): Promise<void> {\n return storage.setItem(key, JSON.stringify(value));\n }\n\n async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n const json = await storage.getItem(key);\n return json ? JSON.parse(json) : null;\n }\n\n _remove(key: string): Promise<void> {\n return storage.removeItem(key);\n }\n\n _addListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n\n _removeListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using React Native will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport { AsyncStorage } from 'react-native';\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth, Persistence } from './src/model/public_types';\n\nimport { initializeAuth } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\nimport { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';\n\n// Core functionality shared by all clients\nexport * from './index.shared';\n\n// Export some Phone symbols\n// providers\nexport { PhoneAuthProvider } from './src/platform_browser/providers/phone';\n\n// strategies\nexport {\n signInWithPhoneNumber,\n linkWithPhoneNumber,\n reauthenticateWithPhoneNumber,\n updatePhoneNumber\n} from './src/platform_browser/strategies/phone';\n\n// MFA\nexport { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone';\n\n/**\n * An implementation of {@link Persistence} of type 'LOCAL' for use in React\n * Native environments.\n *\n * @public\n */\nexport const reactNativeLocalPersistence: Persistence =\n getReactNativePersistence(AsyncStorage);\n\nexport {getReactNativePersistence};\n\nexport function getAuth(app: FirebaseApp = getApp()): Auth {\n const provider = _getProvider(app, 'auth');\n\n if (provider.isInitialized()) {\n return provider.getImmediate();\n }\n\n return initializeAuth(app, {\n persistence: reactNativeLocalPersistence\n });\n}\n\nregisterAuth(ClientPlatform.REACT_NATIVE);\n"],"names":["STORAGE_AVAILABLE_KEY","AsyncStorage","app","getApp","_getProvider","initializeAuth","registerAuth"],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AA2BA;;;;;;;SAOgB,yBAAyB,CACvC,OAAgC;;;;;;;;IAQhC;YAAO;gBAEI,SAAI,uBAA0C;aAqCxD;YAnCO,8BAAY,GAAlB;;;;;;gCAEI,IAAI,CAAC,OAAO,EAAE;oCACZ,sBAAO,KAAK,EAAC;iCACd;gCACD,qBAAM,OAAO,CAAC,OAAO,CAACA,2BAAqB,EAAE,GAAG,CAAC,EAAA;;gCAAjD,SAAiD,CAAC;gCAClD,qBAAM,OAAO,CAAC,UAAU,CAACA,2BAAqB,CAAC,EAAA;;gCAA/C,SAA+C,CAAC;gCAChD,sBAAO,IAAI,EAAC;;;gCAEZ,sBAAO,KAAK,EAAC;;;;;aAEhB;YAED,sBAAI,GAAJ,UAAK,GAAW,EAAE,KAAuB;gBACvC,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;aACpD;YAEK,sBAAI,GAAV,UAAuC,GAAW;;;;;oCACnC,qBAAM,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAA;;gCAAjC,IAAI,GAAG,SAA0B;gCACvC,sBAAO,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,EAAC;;;;aACvC;YAED,yBAAO,GAAP,UAAQ,GAAW;gBACjB,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;aAChC;YAED,8BAAY,GAAZ,UAAa,IAAY,EAAE,SAA+B;;gBAExD,OAAO;aACR;YAED,iCAAe,GAAf,UAAgB,IAAY,EAAE,SAA+B;;gBAE3D,OAAO;aACR;YACH,cAAC;SAAA;QAtCQ,OAAI,GAAY,OAAQ;WAsC/B;AACJ;;ACnFA;;;;;;;;;;;;;;;;AAoDA;;;;;;IAMa,2BAA2B,GACtC,yBAAyB,CAACC,wBAAY,EAAE;SAI1B,OAAO,CAACC,KAA2B;IAA3B,sBAAA,EAAAA,QAAmBC,UAAM,EAAE;IACjD,IAAM,QAAQ,GAAGC,gBAAY,CAACF,KAAG,EAAE,MAAM,CAAC,CAAC;IAE3C,IAAI,QAAQ,CAAC,aAAa,EAAE,EAAE;QAC5B,OAAO,QAAQ,CAAC,YAAY,EAAE,CAAC;KAChC;IAED,OAAOG,oBAAc,CAACH,KAAG,EAAE;QACzB,WAAW,EAAE,2BAA2B;KACzC,CAAC,CAAC;AACL,CAAC;AAEDI,kBAAY,kCAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/rn/index.rn.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { FirebaseApp } from '@firebase/app';
|
|
18
18
|
import { Auth, Persistence } from './src/model/public_types';
|
|
19
|
+
import { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';
|
|
19
20
|
export * from './index.shared';
|
|
20
21
|
export { PhoneAuthProvider } from './src/platform_browser/providers/phone';
|
|
21
22
|
export { signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber } from './src/platform_browser/strategies/phone';
|
|
@@ -27,4 +28,5 @@ export { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions
|
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
export declare const reactNativeLocalPersistence: Persistence;
|
|
31
|
+
export { getReactNativePersistence };
|
|
30
32
|
export declare function getAuth(app?: FirebaseApp): Auth;
|
package/dist/rn/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var phone = require('./phone-
|
|
5
|
+
var phone = require('./phone-9c91b099.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -4180,7 +4180,7 @@ var OAuthProvider = /** @class */ (function (_super) {
|
|
|
4180
4180
|
* // This is the signed-in user
|
|
4181
4181
|
* const user = result.user;
|
|
4182
4182
|
* // This gives you a Facebook Access Token.
|
|
4183
|
-
* const credential =
|
|
4183
|
+
* const credential = FacebookAuthProvider.credentialFromResult(result);
|
|
4184
4184
|
* const token = credential.accessToken;
|
|
4185
4185
|
* }
|
|
4186
4186
|
* ```
|
|
@@ -4195,7 +4195,7 @@ var OAuthProvider = /** @class */ (function (_super) {
|
|
|
4195
4195
|
* // The signed-in user info.
|
|
4196
4196
|
* const user = result.user;
|
|
4197
4197
|
* // This gives you a Facebook Access Token.
|
|
4198
|
-
* const credential =
|
|
4198
|
+
* const credential = FacebookAuthProvider.credentialFromResult(result);
|
|
4199
4199
|
* const token = credential.accessToken;
|
|
4200
4200
|
* ```
|
|
4201
4201
|
*
|
|
@@ -4299,7 +4299,7 @@ var FacebookAuthProvider = /** @class */ (function (_super) {
|
|
|
4299
4299
|
* // This is the signed-in user
|
|
4300
4300
|
* const user = result.user;
|
|
4301
4301
|
* // This gives you a Google Access Token.
|
|
4302
|
-
* const credential =
|
|
4302
|
+
* const credential = GoogleAuthProvider.credentialFromResult(result);
|
|
4303
4303
|
* const token = credential.accessToken;
|
|
4304
4304
|
* }
|
|
4305
4305
|
* ```
|
|
@@ -4315,7 +4315,7 @@ var FacebookAuthProvider = /** @class */ (function (_super) {
|
|
|
4315
4315
|
* // The signed-in user info.
|
|
4316
4316
|
* const user = result.user;
|
|
4317
4317
|
* // This gives you a Google Access Token.
|
|
4318
|
-
* const credential =
|
|
4318
|
+
* const credential = GoogleAuthProvider.credentialFromResult(result);
|
|
4319
4319
|
* const token = credential.accessToken;
|
|
4320
4320
|
* ```
|
|
4321
4321
|
*
|
|
@@ -4428,7 +4428,7 @@ var GoogleAuthProvider = /** @class */ (function (_super) {
|
|
|
4428
4428
|
* // This is the signed-in user
|
|
4429
4429
|
* const user = result.user;
|
|
4430
4430
|
* // This gives you a Github Access Token.
|
|
4431
|
-
* const credential =
|
|
4431
|
+
* const credential = GithubAuthProvider.credentialFromResult(result);
|
|
4432
4432
|
* const token = credential.accessToken;
|
|
4433
4433
|
* }
|
|
4434
4434
|
* ```
|
|
@@ -4443,7 +4443,7 @@ var GoogleAuthProvider = /** @class */ (function (_super) {
|
|
|
4443
4443
|
* // The signed-in user info.
|
|
4444
4444
|
* const user = result.user;
|
|
4445
4445
|
* // This gives you a Github Access Token.
|
|
4446
|
-
* const credential =
|
|
4446
|
+
* const credential = GithubAuthProvider.credentialFromResult(result);
|
|
4447
4447
|
* const token = credential.accessToken;
|
|
4448
4448
|
* ```
|
|
4449
4449
|
* @public
|
|
@@ -4718,7 +4718,7 @@ var SAMLAuthProvider = /** @class */ (function (_super) {
|
|
|
4718
4718
|
* // This is the signed-in user
|
|
4719
4719
|
* const user = result.user;
|
|
4720
4720
|
* // This gives you a Twitter Access Token and Secret.
|
|
4721
|
-
* const credential =
|
|
4721
|
+
* const credential = TwitterAuthProvider.credentialFromResult(result);
|
|
4722
4722
|
* const token = credential.accessToken;
|
|
4723
4723
|
* const secret = credential.secret;
|
|
4724
4724
|
* }
|
|
@@ -4733,7 +4733,7 @@ var SAMLAuthProvider = /** @class */ (function (_super) {
|
|
|
4733
4733
|
* // The signed-in user info.
|
|
4734
4734
|
* const user = result.user;
|
|
4735
4735
|
* // This gives you a Twitter Access Token and Secret.
|
|
4736
|
-
* const credential =
|
|
4736
|
+
* const credential = TwitterAuthProvider.credentialFromResult(result);
|
|
4737
4737
|
* const token = credential.accessToken;
|
|
4738
4738
|
* const secret = credential.secret;
|
|
4739
4739
|
* ```
|
|
@@ -6755,7 +6755,7 @@ function multiFactor(user) {
|
|
|
6755
6755
|
}
|
|
6756
6756
|
|
|
6757
6757
|
var name = "@firebase/auth";
|
|
6758
|
-
var version = "0.19.
|
|
6758
|
+
var version = "0.19.3-canary.ce39a1a07";
|
|
6759
6759
|
|
|
6760
6760
|
/**
|
|
6761
6761
|
* @license
|
|
@@ -8278,4 +8278,4 @@ exports.updateProfile = updateProfile;
|
|
|
8278
8278
|
exports.useDeviceLanguage = useDeviceLanguage;
|
|
8279
8279
|
exports.verifyBeforeUpdateEmail = verifyBeforeUpdateEmail;
|
|
8280
8280
|
exports.verifyPasswordResetCode = verifyPasswordResetCode;
|
|
8281
|
-
//# sourceMappingURL=phone-
|
|
8281
|
+
//# sourceMappingURL=phone-9c91b099.js.map
|