@firebase/auth 0.18.3 → 0.19.0
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 +16 -0
- package/dist/auth-public.d.ts +28 -19
- package/dist/auth.d.ts +29 -20
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/index.rn.d.ts +3 -0
- package/dist/cordova/internal.js +7 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-f608cd47.js → popup_redirect-c65b3459.js} +46 -26
- package/dist/cordova/popup_redirect-c65b3459.js.map +1 -0
- package/dist/cordova/src/core/errors.d.ts +2 -2
- package/dist/cordova/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/cordova/src/mfa/mfa_error.d.ts +4 -5
- package/dist/cordova/src/model/public_types.d.ts +25 -19
- package/dist/cordova/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/cordova/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/cordova/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/cordova/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/esm2017/{index-f41a0691.js → index-238d6fa9.js} +41 -24
- package/dist/esm2017/index-238d6fa9.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/index.rn.d.ts +3 -0
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/core/errors.d.ts +2 -2
- package/dist/esm2017/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/esm2017/src/mfa/mfa_error.d.ts +4 -5
- package/dist/esm2017/src/model/public_types.d.ts +25 -19
- package/dist/esm2017/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/esm2017/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/esm2017/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm2017/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/esm5/{index-fd8b7af5.js → index-47dd1018.js} +51 -27
- package/dist/esm5/index-47dd1018.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/index.rn.d.ts +3 -0
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/core/errors.d.ts +2 -2
- package/dist/esm5/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/esm5/src/mfa/mfa_error.d.ts +4 -5
- package/dist/esm5/src/model/public_types.d.ts +25 -19
- package/dist/esm5/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/esm5/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/esm5/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/esm5/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/index.rn.d.ts +3 -0
- package/dist/index.webworker.esm5.js +17 -16
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-358613ec.js → index-da4673cf.js} +18 -17
- package/dist/node/index-da4673cf.js.map +1 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.rn.d.ts +3 -0
- package/dist/node/internal.js +29 -10
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/core/errors.d.ts +2 -2
- package/dist/node/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/node/src/mfa/mfa_error.d.ts +4 -5
- package/dist/node/src/model/public_types.d.ts +25 -19
- package/dist/node/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/node/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/node/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/node/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/rn/index.js +70 -64
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/index.rn.d.ts +3 -0
- package/dist/rn/internal.js +338 -1465
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{enum_maps-81db3ff6.js → phone-e3d3bcce.js} +1187 -27
- package/dist/rn/phone-e3d3bcce.js.map +1 -0
- package/dist/rn/src/core/errors.d.ts +2 -2
- package/dist/rn/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/rn/src/mfa/mfa_error.d.ts +4 -5
- package/dist/rn/src/model/public_types.d.ts +25 -19
- package/dist/rn/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/rn/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/rn/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/rn/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/dist/src/core/errors.d.ts +2 -2
- package/dist/src/core/strategies/abstract_popup_redirect_operation.d.ts +1 -1
- package/dist/src/mfa/mfa_error.d.ts +4 -5
- package/dist/src/model/public_types.d.ts +25 -19
- package/dist/src/platform_browser/persistence/browser.d.ts +4 -3
- package/dist/src/platform_browser/persistence/browser.test.d.ts +17 -0
- package/dist/src/platform_browser/strategies/phone.d.ts +3 -0
- package/dist/test/helpers/erroring_unavailable_persistence.d.ts +36 -0
- package/package.json +2 -2
- package/dist/cordova/popup_redirect-f608cd47.js.map +0 -1
- package/dist/esm2017/index-f41a0691.js.map +0 -1
- package/dist/esm5/index-fd8b7af5.js.map +0 -1
- package/dist/node/index-358613ec.js.map +0 -1
- package/dist/rn/enum_maps-81db3ff6.js.map +0 -1
|
@@ -22,14 +22,13 @@ import { UserInternal } from '../model/user';
|
|
|
22
22
|
import { AuthCredential } from '../core/credentials';
|
|
23
23
|
import { IdTokenMfaResponse } from '../api/authentication/mfa';
|
|
24
24
|
import { OperationType } from '../model/enums';
|
|
25
|
+
export declare type MultiFactorErrorData = MultiFactorErrorPublic['customData'] & {
|
|
26
|
+
_serverResponse: IdTokenMfaResponse;
|
|
27
|
+
};
|
|
25
28
|
export declare class MultiFactorError extends FirebaseError implements MultiFactorErrorPublic {
|
|
26
29
|
readonly operationType: OperationType;
|
|
27
30
|
readonly user?: UserInternal | undefined;
|
|
28
|
-
readonly
|
|
29
|
-
readonly code: string;
|
|
30
|
-
readonly appName: string;
|
|
31
|
-
readonly serverResponse: IdTokenMfaResponse;
|
|
32
|
-
readonly tenantId?: string;
|
|
31
|
+
readonly customData: MultiFactorErrorData;
|
|
33
32
|
private constructor();
|
|
34
33
|
static _fromErrorAndOperation(auth: AuthInternal, error: FirebaseError, operationType: OperationType, user?: UserInternal): MultiFactorError;
|
|
35
34
|
}
|
|
@@ -101,21 +101,24 @@ export declare type NextOrObserver<T> = NextFn<T | null> | Observer<T | null>;
|
|
|
101
101
|
* @public
|
|
102
102
|
*/
|
|
103
103
|
export interface AuthError extends FirebaseError {
|
|
104
|
-
/**
|
|
105
|
-
readonly
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
104
|
+
/** Details about the Firebase Auth error. */
|
|
105
|
+
readonly customData: {
|
|
106
|
+
/** The name of the Firebase App which triggered this error. */
|
|
107
|
+
readonly appName: string;
|
|
108
|
+
/** The email address of the user's account, used for sign-in and linking. */
|
|
109
|
+
readonly email?: string;
|
|
110
|
+
/** The phone number of the user's account, used for sign-in and linking. */
|
|
111
|
+
readonly phoneNumber?: string;
|
|
112
|
+
/**
|
|
113
|
+
* The tenant ID being used for sign-in and linking.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* If you use {@link signInWithRedirect} to sign in,
|
|
117
|
+
* you have to set the tenant ID on the {@link Auth} instance again as the tenant ID is not persisted
|
|
118
|
+
* after redirection.
|
|
119
|
+
*/
|
|
120
|
+
readonly tenantId?: string;
|
|
121
|
+
};
|
|
119
122
|
}
|
|
120
123
|
/**
|
|
121
124
|
* Interface representing an {@link Auth} instance's settings.
|
|
@@ -559,10 +562,13 @@ export interface MultiFactorAssertion {
|
|
|
559
562
|
* @public
|
|
560
563
|
*/
|
|
561
564
|
export interface MultiFactorError extends AuthError {
|
|
562
|
-
/**
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
565
|
+
/** Details about the MultiFactorError. */
|
|
566
|
+
readonly customData: AuthError['customData'] & {
|
|
567
|
+
/**
|
|
568
|
+
* The type of operation (sign-in, linking, or re-authentication) that raised the error.
|
|
569
|
+
*/
|
|
570
|
+
readonly operationType: typeof OperationTypeMap[keyof typeof OperationTypeMap];
|
|
571
|
+
};
|
|
566
572
|
}
|
|
567
573
|
/**
|
|
568
574
|
* A structure containing the information of a second factor entity.
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { PersistenceValue, PersistenceType } from '../../core/persistence';
|
|
18
18
|
export declare abstract class BrowserPersistenceClass {
|
|
19
|
-
protected readonly
|
|
19
|
+
protected readonly storageRetriever: () => Storage;
|
|
20
20
|
readonly type: PersistenceType;
|
|
21
|
-
protected constructor(
|
|
22
|
-
_isAvailable(
|
|
21
|
+
protected constructor(storageRetriever: () => Storage, type: PersistenceType);
|
|
22
|
+
_isAvailable(): Promise<boolean>;
|
|
23
23
|
_set(key: string, value: PersistenceValue): Promise<void>;
|
|
24
24
|
_get<T extends PersistenceValue>(key: string): Promise<T | null>;
|
|
25
25
|
_remove(key: string): Promise<void>;
|
|
26
|
+
protected get storage(): Storage;
|
|
26
27
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2021 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
@@ -29,6 +29,9 @@ import { AuthInternal } from '../../model/auth';
|
|
|
29
29
|
*
|
|
30
30
|
* For abuse prevention, this method also requires a {@link ApplicationVerifier}.
|
|
31
31
|
* This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.
|
|
32
|
+
* This function can work on other platforms that do not support the
|
|
33
|
+
* {@link RecaptchaVerifier} (like React Native), but you need to use a
|
|
34
|
+
* third-party {@link ApplicationVerifier} implementation.
|
|
32
35
|
*
|
|
33
36
|
* @example
|
|
34
37
|
* ```javascript
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2020 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { PersistenceInternal, PersistenceType, PersistenceValue } from '../../src/core/persistence';
|
|
18
|
+
/**
|
|
19
|
+
* Helper class for mocking completely broken persistence that errors when
|
|
20
|
+
* accessed.
|
|
21
|
+
*
|
|
22
|
+
* When disabling cookies in Chrome entirely, for example, simply reading the
|
|
23
|
+
* "localStorage" field in "window" will throw an error, but this can't be
|
|
24
|
+
* checked for by calling `'localStorage' in window`. This class simulates a
|
|
25
|
+
* situation where _isAvailable works correctly but all other methods fail.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ErroringUnavailablePersistence implements PersistenceInternal {
|
|
28
|
+
type: PersistenceType;
|
|
29
|
+
_isAvailable(): Promise<boolean>;
|
|
30
|
+
_set(): Promise<void>;
|
|
31
|
+
_get<T extends PersistenceValue>(): Promise<T | null>;
|
|
32
|
+
_remove(): Promise<void>;
|
|
33
|
+
_addListener(): void;
|
|
34
|
+
_removeListener(): void;
|
|
35
|
+
_shouldAllowMigration: boolean;
|
|
36
|
+
}
|
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
|
|
7
|
+
var phone = require('./phone-e3d3bcce.js');
|
|
8
8
|
var tslib = require('tslib');
|
|
9
9
|
require('@firebase/util');
|
|
10
10
|
require('@firebase/component');
|
|
@@ -54,10 +54,10 @@ function getReactNativePersistence(storage) {
|
|
|
54
54
|
if (!storage) {
|
|
55
55
|
return [2 /*return*/, false];
|
|
56
56
|
}
|
|
57
|
-
return [4 /*yield*/, storage.setItem(
|
|
57
|
+
return [4 /*yield*/, storage.setItem(phone.STORAGE_AVAILABLE_KEY, '1')];
|
|
58
58
|
case 1:
|
|
59
59
|
_b.sent();
|
|
60
|
-
return [4 /*yield*/, storage.removeItem(
|
|
60
|
+
return [4 /*yield*/, storage.removeItem(phone.STORAGE_AVAILABLE_KEY)];
|
|
61
61
|
case 2:
|
|
62
62
|
_b.sent();
|
|
63
63
|
return [2 /*return*/, true];
|
|
@@ -131,71 +131,77 @@ function getAuth(app$1) {
|
|
|
131
131
|
if (provider.isInitialized()) {
|
|
132
132
|
return provider.getImmediate();
|
|
133
133
|
}
|
|
134
|
-
return
|
|
134
|
+
return phone.initializeAuth(app$1, {
|
|
135
135
|
persistence: reactNativeLocalPersistence
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
|
-
|
|
138
|
+
phone.registerAuth("ReactNative" /* REACT_NATIVE */);
|
|
139
139
|
|
|
140
|
-
exports.ActionCodeOperation =
|
|
141
|
-
exports.ActionCodeURL =
|
|
142
|
-
exports.AuthCredential =
|
|
143
|
-
exports.AuthErrorCodes =
|
|
144
|
-
exports.EmailAuthCredential =
|
|
145
|
-
exports.EmailAuthProvider =
|
|
146
|
-
exports.FacebookAuthProvider =
|
|
147
|
-
exports.FactorId =
|
|
148
|
-
exports.GithubAuthProvider =
|
|
149
|
-
exports.GoogleAuthProvider =
|
|
150
|
-
exports.OAuthCredential =
|
|
151
|
-
exports.OAuthProvider =
|
|
152
|
-
exports.OperationType =
|
|
153
|
-
exports.PhoneAuthCredential =
|
|
154
|
-
exports.
|
|
155
|
-
exports.
|
|
156
|
-
exports.
|
|
157
|
-
exports.
|
|
158
|
-
exports.
|
|
159
|
-
exports.
|
|
160
|
-
exports.
|
|
161
|
-
exports.
|
|
162
|
-
exports.
|
|
163
|
-
exports.
|
|
164
|
-
exports.
|
|
165
|
-
exports.
|
|
166
|
-
exports.
|
|
167
|
-
exports.
|
|
168
|
-
exports.
|
|
169
|
-
exports.
|
|
170
|
-
exports.
|
|
171
|
-
exports.
|
|
172
|
-
exports.
|
|
173
|
-
exports.
|
|
174
|
-
exports.
|
|
175
|
-
exports.
|
|
176
|
-
exports.
|
|
177
|
-
exports.
|
|
178
|
-
exports.
|
|
179
|
-
exports.
|
|
180
|
-
exports.
|
|
181
|
-
exports.
|
|
182
|
-
exports.
|
|
183
|
-
exports.
|
|
184
|
-
exports.
|
|
185
|
-
exports.
|
|
186
|
-
exports.
|
|
187
|
-
exports.
|
|
188
|
-
exports.
|
|
189
|
-
exports.
|
|
190
|
-
exports.
|
|
191
|
-
exports.
|
|
192
|
-
exports.
|
|
193
|
-
exports.
|
|
194
|
-
exports.
|
|
195
|
-
exports.
|
|
196
|
-
exports.
|
|
197
|
-
exports.
|
|
198
|
-
exports.
|
|
140
|
+
exports.ActionCodeOperation = phone.ActionCodeOperation;
|
|
141
|
+
exports.ActionCodeURL = phone.ActionCodeURL;
|
|
142
|
+
exports.AuthCredential = phone.AuthCredential;
|
|
143
|
+
exports.AuthErrorCodes = phone.AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY;
|
|
144
|
+
exports.EmailAuthCredential = phone.EmailAuthCredential;
|
|
145
|
+
exports.EmailAuthProvider = phone.EmailAuthProvider;
|
|
146
|
+
exports.FacebookAuthProvider = phone.FacebookAuthProvider;
|
|
147
|
+
exports.FactorId = phone.FactorId;
|
|
148
|
+
exports.GithubAuthProvider = phone.GithubAuthProvider;
|
|
149
|
+
exports.GoogleAuthProvider = phone.GoogleAuthProvider;
|
|
150
|
+
exports.OAuthCredential = phone.OAuthCredential;
|
|
151
|
+
exports.OAuthProvider = phone.OAuthProvider;
|
|
152
|
+
exports.OperationType = phone.OperationType;
|
|
153
|
+
exports.PhoneAuthCredential = phone.PhoneAuthCredential;
|
|
154
|
+
exports.PhoneAuthProvider = phone.PhoneAuthProvider;
|
|
155
|
+
exports.PhoneMultiFactorGenerator = phone.PhoneMultiFactorGenerator;
|
|
156
|
+
exports.ProviderId = phone.ProviderId;
|
|
157
|
+
exports.SAMLAuthProvider = phone.SAMLAuthProvider;
|
|
158
|
+
exports.SignInMethod = phone.SignInMethod;
|
|
159
|
+
exports.TwitterAuthProvider = phone.TwitterAuthProvider;
|
|
160
|
+
exports.applyActionCode = phone.applyActionCode;
|
|
161
|
+
exports.checkActionCode = phone.checkActionCode;
|
|
162
|
+
exports.confirmPasswordReset = phone.confirmPasswordReset;
|
|
163
|
+
exports.connectAuthEmulator = phone.connectAuthEmulator;
|
|
164
|
+
exports.createUserWithEmailAndPassword = phone.createUserWithEmailAndPassword;
|
|
165
|
+
exports.debugErrorMap = phone.debugErrorMap;
|
|
166
|
+
exports.deleteUser = phone.deleteUser;
|
|
167
|
+
exports.fetchSignInMethodsForEmail = phone.fetchSignInMethodsForEmail;
|
|
168
|
+
exports.getAdditionalUserInfo = phone.getAdditionalUserInfo;
|
|
169
|
+
exports.getIdToken = phone.getIdToken;
|
|
170
|
+
exports.getIdTokenResult = phone.getIdTokenResult;
|
|
171
|
+
exports.getMultiFactorResolver = phone.getMultiFactorResolver;
|
|
172
|
+
exports.inMemoryPersistence = phone.inMemoryPersistence;
|
|
173
|
+
exports.initializeAuth = phone.initializeAuth;
|
|
174
|
+
exports.isSignInWithEmailLink = phone.isSignInWithEmailLink;
|
|
175
|
+
exports.linkWithCredential = phone.linkWithCredential;
|
|
176
|
+
exports.linkWithPhoneNumber = phone.linkWithPhoneNumber;
|
|
177
|
+
exports.multiFactor = phone.multiFactor;
|
|
178
|
+
exports.onAuthStateChanged = phone.onAuthStateChanged;
|
|
179
|
+
exports.onIdTokenChanged = phone.onIdTokenChanged;
|
|
180
|
+
exports.parseActionCodeURL = phone.parseActionCodeURL;
|
|
181
|
+
exports.prodErrorMap = phone.prodErrorMap;
|
|
182
|
+
exports.reauthenticateWithCredential = phone.reauthenticateWithCredential;
|
|
183
|
+
exports.reauthenticateWithPhoneNumber = phone.reauthenticateWithPhoneNumber;
|
|
184
|
+
exports.reload = phone.reload;
|
|
185
|
+
exports.sendEmailVerification = phone.sendEmailVerification;
|
|
186
|
+
exports.sendPasswordResetEmail = phone.sendPasswordResetEmail;
|
|
187
|
+
exports.sendSignInLinkToEmail = phone.sendSignInLinkToEmail;
|
|
188
|
+
exports.setPersistence = phone.setPersistence;
|
|
189
|
+
exports.signInAnonymously = phone.signInAnonymously;
|
|
190
|
+
exports.signInWithCredential = phone.signInWithCredential;
|
|
191
|
+
exports.signInWithCustomToken = phone.signInWithCustomToken;
|
|
192
|
+
exports.signInWithEmailAndPassword = phone.signInWithEmailAndPassword;
|
|
193
|
+
exports.signInWithEmailLink = phone.signInWithEmailLink;
|
|
194
|
+
exports.signInWithPhoneNumber = phone.signInWithPhoneNumber;
|
|
195
|
+
exports.signOut = phone.signOut;
|
|
196
|
+
exports.unlink = phone.unlink;
|
|
197
|
+
exports.updateCurrentUser = phone.updateCurrentUser;
|
|
198
|
+
exports.updateEmail = phone.updateEmail;
|
|
199
|
+
exports.updatePassword = phone.updatePassword;
|
|
200
|
+
exports.updatePhoneNumber = phone.updatePhoneNumber;
|
|
201
|
+
exports.updateProfile = phone.updateProfile;
|
|
202
|
+
exports.useDeviceLanguage = phone.useDeviceLanguage;
|
|
203
|
+
exports.verifyBeforeUpdateEmail = phone.verifyBeforeUpdateEmail;
|
|
204
|
+
exports.verifyPasswordResetCode = phone.verifyPasswordResetCode;
|
|
199
205
|
exports.getAuth = getAuth;
|
|
200
206
|
exports.reactNativeLocalPersistence = reactNativeLocalPersistence;
|
|
201
207
|
//# 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 class that wraps AsyncStorage imported from\n * `react-native` or `@react-native-community/async-storage`.\n *\n * Creates a \"new\"-able subclass on the fly that has an empty constructor.\n *\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 */\n\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\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/**\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 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;;;;;;;;;;;;;SAcgB,yBAAyB,CACvC,OAAgC;;IAEhC;YAAO;gBAEI,SAAI,uBAA0C;aAqCxD;YAnCO,8BAAY,GAAlB;;;;;;gCAEI,IAAI,CAAC,OAAO,EAAE;oCACZ,sBAAO,KAAK,EAAC;iCACd;gCACD,qBAAM,OAAO,CAAC,OAAO,CAACA
|
|
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 class that wraps AsyncStorage imported from\n * `react-native` or `@react-native-community/async-storage`.\n *\n * Creates a \"new\"-able subclass on the fly that has an empty constructor.\n *\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 */\n\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\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 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;;;;;;;;;;;;;SAcgB,yBAAyB,CACvC,OAAgC;;IAEhC;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;;ACpFA;;;;;;;;;;;;;;;;AAoDA;;;;;;IAMa,2BAA2B,GACtC,yBAAyB,CAACC,wBAAY,EAAE;SAE1B,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
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
import { FirebaseApp } from '@firebase/app';
|
|
18
18
|
import { Auth, Persistence } from './src/model/public_types';
|
|
19
19
|
export * from './index.shared';
|
|
20
|
+
export { PhoneAuthProvider } from './src/platform_browser/providers/phone';
|
|
21
|
+
export { signInWithPhoneNumber, linkWithPhoneNumber, reauthenticateWithPhoneNumber, updatePhoneNumber } from './src/platform_browser/strategies/phone';
|
|
22
|
+
export { PhoneMultiFactorGenerator } from './src/platform_browser/mfa/assertions/phone';
|
|
20
23
|
/**
|
|
21
24
|
* An implementation of {@link Persistence} of type 'LOCAL' for use in React
|
|
22
25
|
* Native environments.
|