@firebase/auth 0.18.3 → 0.19.0-canary.477bdef13
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-d7b9a2c0.js} +54 -33
- package/dist/cordova/popup_redirect-d7b9a2c0.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-030cefd0.js} +43 -25
- package/dist/esm2017/index-030cefd0.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-5050030d.js} +59 -34
- package/dist/esm5/index-5050030d.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 +25 -23
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/{index-358613ec.js → index-99e8c13b.js} +26 -24
- package/dist/node/index-99e8c13b.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-c7fcf861.js} +1195 -34
- package/dist/rn/phone-c7fcf861.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 +6 -6
- 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
package/dist/esm2017/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-030cefd0.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import 'tslib';
|
|
@@ -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.
|
package/dist/esm2017/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ao as _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI 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, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay 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 _isIOS7Or8, ap as debugAssert, aq as _isIOS, ar as _isAndroid, as as _fail, at as _getRedirectUrl, au as _getProjectConfig, av as _createError, aw as _assert, ax as _getInstance, b as browserLocalPersistence, ay as _persistenceKeyName, az as AuthEventManager, a as browserSessionPersistence, aA as _getRedirectResult, aB as _clearRedirectOutcomes, aC as _castAuth } from './index-030cefd0.js';
|
|
2
|
+
export { A as ActionCodeOperation, ac as ActionCodeURL, G as AuthCredential, C as AuthErrorCodes, aE as AuthImpl, aH as AuthPopup, H as EmailAuthCredential, L as EmailAuthProvider, M as FacebookAuthProvider, F as FactorId, aI 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, aJ as SAMLAuthCredential, U as SAMLAuthProvider, S as SignInMethod, V as TwitterAuthProvider, aD as UserImpl, aw as _assert, aC as _castAuth, as as _fail, aG as _generateEventId, aF as _getClientVersion, ax as _getInstance, aA as _getRedirectResult, ay 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-030cefd0.js';
|
|
3
3
|
import { querystringDecode } from '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
|
5
5
|
import 'tslib';
|
|
@@ -147,7 +147,7 @@ export interface NamedErrorParams {
|
|
|
147
147
|
phoneNumber?: string;
|
|
148
148
|
tenantId?: string;
|
|
149
149
|
user?: User;
|
|
150
|
-
|
|
150
|
+
_serverResponse?: object;
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
153
|
* @internal
|
|
@@ -180,7 +180,7 @@ export interface AuthErrorParams extends GenericAuthErrorParams {
|
|
|
180
180
|
};
|
|
181
181
|
[AuthErrorCode.MFA_REQUIRED]: {
|
|
182
182
|
appName: AppName;
|
|
183
|
-
|
|
183
|
+
_serverResponse: IdTokenMfaResponse;
|
|
184
184
|
};
|
|
185
185
|
[AuthErrorCode.INVALID_CORDOVA_CONFIGURATION]: {
|
|
186
186
|
appName: AppName;
|
|
@@ -26,7 +26,7 @@ export declare abstract class AbstractPopupRedirectOperation implements AuthEven
|
|
|
26
26
|
protected readonly auth: AuthInternal;
|
|
27
27
|
protected readonly resolver: PopupRedirectResolverInternal;
|
|
28
28
|
protected user?: UserInternal | undefined;
|
|
29
|
-
|
|
29
|
+
protected readonly bypassAuthState: boolean;
|
|
30
30
|
private pendingPromise;
|
|
31
31
|
private eventManager;
|
|
32
32
|
readonly filter: AuthEventType[];
|
|
@@ -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
|
+
}
|
|
@@ -1042,7 +1042,7 @@ function _performSignInRequest(auth, method, path, request, customErrorMap) {
|
|
|
1042
1042
|
serverResponse = (_a.sent());
|
|
1043
1043
|
if ('mfaPendingCredential' in serverResponse) {
|
|
1044
1044
|
_fail(auth, "multi-factor-auth-required" /* MFA_REQUIRED */, {
|
|
1045
|
-
|
|
1045
|
+
_serverResponse: serverResponse
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
1048
|
return [2 /*return*/, serverResponse];
|
|
@@ -2505,9 +2505,9 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2505
2505
|
// promise resolution)
|
|
2506
2506
|
this._initializationPromise = this.queue(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
2507
2507
|
var _a;
|
|
2508
|
-
var _b;
|
|
2509
|
-
return __generator(this, function (
|
|
2510
|
-
switch (
|
|
2508
|
+
var _b, _c;
|
|
2509
|
+
return __generator(this, function (_d) {
|
|
2510
|
+
switch (_d.label) {
|
|
2511
2511
|
case 0:
|
|
2512
2512
|
if (this._deleted) {
|
|
2513
2513
|
return [2 /*return*/];
|
|
@@ -2515,18 +2515,19 @@ var AuthImpl = /** @class */ (function () {
|
|
|
2515
2515
|
_a = this;
|
|
2516
2516
|
return [4 /*yield*/, PersistenceUserManager.create(this, persistenceHierarchy)];
|
|
2517
2517
|
case 1:
|
|
2518
|
-
_a.persistenceManager =
|
|
2518
|
+
_a.persistenceManager = _d.sent();
|
|
2519
2519
|
if (this._deleted) {
|
|
2520
2520
|
return [2 /*return*/];
|
|
2521
2521
|
}
|
|
2522
2522
|
if (!((_b = this._popupRedirectResolver) === null || _b === void 0 ? void 0 : _b._shouldInitProactively)) return [3 /*break*/, 3];
|
|
2523
2523
|
return [4 /*yield*/, this._popupRedirectResolver._initialize(this)];
|
|
2524
2524
|
case 2:
|
|
2525
|
-
|
|
2526
|
-
|
|
2525
|
+
_d.sent();
|
|
2526
|
+
_d.label = 3;
|
|
2527
2527
|
case 3: return [4 /*yield*/, this.initializeCurrentUser(popupRedirectResolver)];
|
|
2528
2528
|
case 4:
|
|
2529
|
-
|
|
2529
|
+
_d.sent();
|
|
2530
|
+
this.lastNotifiedUid = ((_c = this.currentUser) === null || _c === void 0 ? void 0 : _c.uid) || null;
|
|
2530
2531
|
if (this._deleted) {
|
|
2531
2532
|
return [2 /*return*/];
|
|
2532
2533
|
}
|
|
@@ -5079,14 +5080,14 @@ var MultiFactorError = /** @class */ (function (_super) {
|
|
|
5079
5080
|
var _this = _super.call(this, error.code, error.message) || this;
|
|
5080
5081
|
_this.operationType = operationType;
|
|
5081
5082
|
_this.user = user;
|
|
5082
|
-
_this.name = 'FirebaseError';
|
|
5083
5083
|
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
5084
5084
|
Object.setPrototypeOf(_this, MultiFactorError.prototype);
|
|
5085
|
-
_this.
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5085
|
+
_this.customData = {
|
|
5086
|
+
appName: auth.name,
|
|
5087
|
+
tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,
|
|
5088
|
+
_serverResponse: error.customData._serverResponse,
|
|
5089
|
+
operationType: operationType,
|
|
5090
|
+
};
|
|
5090
5091
|
return _this;
|
|
5091
5092
|
}
|
|
5092
5093
|
MultiFactorError._fromErrorAndOperation = function (auth, error, operationType, user) {
|
|
@@ -6624,11 +6625,12 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
6624
6625
|
MultiFactorResolverImpl._fromError = function (authExtern, error) {
|
|
6625
6626
|
var _this = this;
|
|
6626
6627
|
var auth = _castAuth(authExtern);
|
|
6627
|
-
var
|
|
6628
|
+
var serverResponse = error.customData._serverResponse;
|
|
6629
|
+
var hints = (serverResponse.mfaInfo || []).map(function (enrollment) {
|
|
6628
6630
|
return MultiFactorInfoImpl._fromServerResponse(auth, enrollment);
|
|
6629
6631
|
});
|
|
6630
|
-
_assert(
|
|
6631
|
-
var session = MultiFactorSessionImpl._fromMfaPendingCredential(
|
|
6632
|
+
_assert(serverResponse.mfaPendingCredential, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
6633
|
+
var session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);
|
|
6632
6634
|
return new MultiFactorResolverImpl(session, hints, function (assertion) { return __awaiter(_this, void 0, void 0, function () {
|
|
6633
6635
|
var mfaResponse, idTokenResponse, _a, userCredential;
|
|
6634
6636
|
return __generator(this, function (_b) {
|
|
@@ -6637,9 +6639,9 @@ var MultiFactorResolverImpl = /** @class */ (function () {
|
|
|
6637
6639
|
case 1:
|
|
6638
6640
|
mfaResponse = _b.sent();
|
|
6639
6641
|
// Clear out the unneeded fields from the old login response
|
|
6640
|
-
delete
|
|
6641
|
-
delete
|
|
6642
|
-
idTokenResponse = __assign(__assign({},
|
|
6642
|
+
delete serverResponse.mfaInfo;
|
|
6643
|
+
delete serverResponse.mfaPendingCredential;
|
|
6644
|
+
idTokenResponse = __assign(__assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });
|
|
6643
6645
|
_a = error.operationType;
|
|
6644
6646
|
switch (_a) {
|
|
6645
6647
|
case "signIn" /* SIGN_IN */: return [3 /*break*/, 2];
|
|
@@ -6689,8 +6691,8 @@ function getMultiFactorResolver(auth, error) {
|
|
|
6689
6691
|
var _a;
|
|
6690
6692
|
var authModular = getModularInstance(auth);
|
|
6691
6693
|
var errorInternal = error;
|
|
6692
|
-
_assert(error.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
6693
|
-
_assert((_a = errorInternal.
|
|
6694
|
+
_assert(error.customData.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
6695
|
+
_assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
6694
6696
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
6695
6697
|
}
|
|
6696
6698
|
|
|
@@ -6870,8 +6872,8 @@ var STORAGE_AVAILABLE_KEY = '__sak';
|
|
|
6870
6872
|
// Both have the same implementation but use a different underlying storage
|
|
6871
6873
|
// object.
|
|
6872
6874
|
var BrowserPersistenceClass = /** @class */ (function () {
|
|
6873
|
-
function BrowserPersistenceClass(
|
|
6874
|
-
this.
|
|
6875
|
+
function BrowserPersistenceClass(storageRetriever, type) {
|
|
6876
|
+
this.storageRetriever = storageRetriever;
|
|
6875
6877
|
this.type = type;
|
|
6876
6878
|
}
|
|
6877
6879
|
BrowserPersistenceClass.prototype._isAvailable = function () {
|
|
@@ -6899,6 +6901,13 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
6899
6901
|
this.storage.removeItem(key);
|
|
6900
6902
|
return Promise.resolve();
|
|
6901
6903
|
};
|
|
6904
|
+
Object.defineProperty(BrowserPersistenceClass.prototype, "storage", {
|
|
6905
|
+
get: function () {
|
|
6906
|
+
return this.storageRetriever();
|
|
6907
|
+
},
|
|
6908
|
+
enumerable: false,
|
|
6909
|
+
configurable: true
|
|
6910
|
+
});
|
|
6902
6911
|
return BrowserPersistenceClass;
|
|
6903
6912
|
}());
|
|
6904
6913
|
|
|
@@ -6929,7 +6938,7 @@ var IE10_LOCAL_STORAGE_SYNC_DELAY = 10;
|
|
|
6929
6938
|
var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
6930
6939
|
__extends(BrowserLocalPersistence, _super);
|
|
6931
6940
|
function BrowserLocalPersistence() {
|
|
6932
|
-
var _this = _super.call(this, window.localStorage, "LOCAL" /* LOCAL */) || this;
|
|
6941
|
+
var _this = _super.call(this, function () { return window.localStorage; }, "LOCAL" /* LOCAL */) || this;
|
|
6933
6942
|
_this.boundEventHandler = function (event, poll) { return _this.onStorageEvent(event, poll); };
|
|
6934
6943
|
_this.listeners = {};
|
|
6935
6944
|
_this.localCache = {};
|
|
@@ -7165,7 +7174,7 @@ var browserLocalPersistence = BrowserLocalPersistence;
|
|
|
7165
7174
|
var BrowserSessionPersistence = /** @class */ (function (_super) {
|
|
7166
7175
|
__extends(BrowserSessionPersistence, _super);
|
|
7167
7176
|
function BrowserSessionPersistence() {
|
|
7168
|
-
return _super.call(this, window.sessionStorage, "SESSION" /* SESSION */) || this;
|
|
7177
|
+
return _super.call(this, function () { return window.sessionStorage; }, "SESSION" /* SESSION */) || this;
|
|
7169
7178
|
}
|
|
7170
7179
|
BrowserSessionPersistence.prototype._addListener = function (_key, _listener) {
|
|
7171
7180
|
// Listeners are not supported for session storage since it cannot be shared across windows
|
|
@@ -8729,6 +8738,9 @@ var ConfirmationResultImpl = /** @class */ (function () {
|
|
|
8729
8738
|
*
|
|
8730
8739
|
* For abuse prevention, this method also requires a {@link ApplicationVerifier}.
|
|
8731
8740
|
* This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.
|
|
8741
|
+
* This function can work on other platforms that do not support the
|
|
8742
|
+
* {@link RecaptchaVerifier} (like React Native), but you need to use a
|
|
8743
|
+
* third-party {@link ApplicationVerifier} implementation.
|
|
8732
8744
|
*
|
|
8733
8745
|
* @example
|
|
8734
8746
|
* ```javascript
|
|
@@ -9639,7 +9651,13 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
9639
9651
|
case 7:
|
|
9640
9652
|
redirectOutcomeMap.set(this.auth._key(), readyOutcome);
|
|
9641
9653
|
_b.label = 8;
|
|
9642
|
-
case 8:
|
|
9654
|
+
case 8:
|
|
9655
|
+
// If we're not bypassing auth state, the ready outcome should be set to
|
|
9656
|
+
// null.
|
|
9657
|
+
if (!this.bypassAuthState) {
|
|
9658
|
+
redirectOutcomeMap.set(this.auth._key(), function () { return Promise.resolve(null); });
|
|
9659
|
+
}
|
|
9660
|
+
return [2 /*return*/, readyOutcome()];
|
|
9643
9661
|
}
|
|
9644
9662
|
});
|
|
9645
9663
|
});
|
|
@@ -9685,16 +9703,22 @@ var RedirectAction = /** @class */ (function (_super) {
|
|
|
9685
9703
|
}(AbstractPopupRedirectOperation));
|
|
9686
9704
|
function _getAndClearPendingRedirectStatus(resolver, auth) {
|
|
9687
9705
|
return __awaiter(this, void 0, void 0, function () {
|
|
9688
|
-
var key, hasPendingRedirect;
|
|
9706
|
+
var key, persistence, hasPendingRedirect;
|
|
9689
9707
|
return __generator(this, function (_a) {
|
|
9690
9708
|
switch (_a.label) {
|
|
9691
9709
|
case 0:
|
|
9692
9710
|
key = pendingRedirectKey(auth);
|
|
9693
|
-
|
|
9711
|
+
persistence = resolverPersistence(resolver);
|
|
9712
|
+
return [4 /*yield*/, persistence._isAvailable()];
|
|
9694
9713
|
case 1:
|
|
9695
|
-
|
|
9696
|
-
|
|
9714
|
+
if (!(_a.sent())) {
|
|
9715
|
+
return [2 /*return*/, false];
|
|
9716
|
+
}
|
|
9717
|
+
return [4 /*yield*/, persistence._get(key)];
|
|
9697
9718
|
case 2:
|
|
9719
|
+
hasPendingRedirect = (_a.sent()) === 'true';
|
|
9720
|
+
return [4 /*yield*/, persistence._remove(key)];
|
|
9721
|
+
case 3:
|
|
9698
9722
|
_a.sent();
|
|
9699
9723
|
return [2 /*return*/, hasPendingRedirect];
|
|
9700
9724
|
}
|
|
@@ -10351,7 +10375,8 @@ var IFRAME_ATTRIBUTES = {
|
|
|
10351
10375
|
top: '-100px',
|
|
10352
10376
|
width: '1px',
|
|
10353
10377
|
height: '1px'
|
|
10354
|
-
}
|
|
10378
|
+
},
|
|
10379
|
+
'aria-hidden': 'true'
|
|
10355
10380
|
};
|
|
10356
10381
|
// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to
|
|
10357
10382
|
// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.
|
|
@@ -10807,7 +10832,7 @@ var PhoneMultiFactorGenerator = /** @class */ (function () {
|
|
|
10807
10832
|
}());
|
|
10808
10833
|
|
|
10809
10834
|
var name = "@firebase/auth";
|
|
10810
|
-
var version = "0.
|
|
10835
|
+
var version = "0.19.0-canary.477bdef13";
|
|
10811
10836
|
|
|
10812
10837
|
/**
|
|
10813
10838
|
* @license
|
|
@@ -11012,4 +11037,4 @@ function getAuth(app) {
|
|
|
11012
11037
|
registerAuth("Browser" /* BROWSER */);
|
|
11013
11038
|
|
|
11014
11039
|
export { sendPasswordResetEmail as $, ActionCodeOperation as A, prodErrorMap as B, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as C, initializeAuth as D, connectAuthEmulator as E, FactorId as F, AuthCredential as G, EmailAuthCredential as H, OAuthCredential as I, PhoneAuthCredential as J, inMemoryPersistence as K, EmailAuthProvider as L, FacebookAuthProvider as M, GoogleAuthProvider as N, OperationType as O, PhoneAuthProvider as P, GithubAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, OAuthProvider as T, SAMLAuthProvider as U, TwitterAuthProvider as V, signInAnonymously as W, signInWithCredential as X, linkWithCredential as Y, reauthenticateWithCredential as Z, signInWithCustomToken as _, browserSessionPersistence as a, confirmPasswordReset as a0, applyActionCode as a1, checkActionCode as a2, verifyPasswordResetCode as a3, createUserWithEmailAndPassword as a4, signInWithEmailAndPassword as a5, sendSignInLinkToEmail as a6, isSignInWithEmailLink as a7, signInWithEmailLink as a8, fetchSignInMethodsForEmail as a9, _clearRedirectOutcomes as aA, _getRedirectResult as aB, _castAuth as aC, UserImpl as aD, AuthImpl as aE, _getClientVersion as aF, _generateEventId as aG, AuthPopup as aH, FetchProvider as aI, SAMLAuthCredential as aJ, sendEmailVerification as aa, verifyBeforeUpdateEmail as ab, ActionCodeURL as ac, parseActionCodeURL as ad, updateProfile as ae, updateEmail as af, updatePassword as ag, getIdToken as ah, getIdTokenResult as ai, unlink as aj, getAdditionalUserInfo as ak, reload as al, getMultiFactorResolver as am, multiFactor as an, _isAndroid as ao, _isIOS7Or8 as ap, _isIOS as aq, _fail as ar, _getRedirectUrl as as, debugAssert as at, _getProjectConfig as au, _createError as av, _assert as aw, AuthEventManager as ax, _getInstance as ay, _persistenceKeyName as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, getAuth as n, ProviderId as o, setPersistence as p, onIdTokenChanged as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, onAuthStateChanged as t, updatePhoneNumber as u, useDeviceLanguage as v, updateCurrentUser as w, signOut as x, deleteUser as y, debugErrorMap as z };
|
|
11015
|
-
//# sourceMappingURL=index-
|
|
11040
|
+
//# sourceMappingURL=index-5050030d.js.map
|