@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
|
@@ -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
|
+
}
|
|
@@ -985,7 +985,7 @@ async function _performSignInRequest(auth, method, path, request, customErrorMap
|
|
|
985
985
|
const serverResponse = (await _performApiRequest(auth, method, path, request, customErrorMap));
|
|
986
986
|
if ('mfaPendingCredential' in serverResponse) {
|
|
987
987
|
_fail(auth, "multi-factor-auth-required" /* MFA_REQUIRED */, {
|
|
988
|
-
serverResponse
|
|
988
|
+
_serverResponse: serverResponse
|
|
989
989
|
});
|
|
990
990
|
}
|
|
991
991
|
return serverResponse;
|
|
@@ -2174,7 +2174,7 @@ class AuthImpl {
|
|
|
2174
2174
|
// Have to check for app deletion throughout initialization (after each
|
|
2175
2175
|
// promise resolution)
|
|
2176
2176
|
this._initializationPromise = this.queue(async () => {
|
|
2177
|
-
var _a;
|
|
2177
|
+
var _a, _b;
|
|
2178
2178
|
if (this._deleted) {
|
|
2179
2179
|
return;
|
|
2180
2180
|
}
|
|
@@ -2188,6 +2188,7 @@ class AuthImpl {
|
|
|
2188
2188
|
await this._popupRedirectResolver._initialize(this);
|
|
2189
2189
|
}
|
|
2190
2190
|
await this.initializeCurrentUser(popupRedirectResolver);
|
|
2191
|
+
this.lastNotifiedUid = ((_b = this.currentUser) === null || _b === void 0 ? void 0 : _b.uid) || null;
|
|
2191
2192
|
if (this._deleted) {
|
|
2192
2193
|
return;
|
|
2193
2194
|
}
|
|
@@ -4420,14 +4421,14 @@ class MultiFactorError extends FirebaseError {
|
|
|
4420
4421
|
super(error.code, error.message);
|
|
4421
4422
|
this.operationType = operationType;
|
|
4422
4423
|
this.user = user;
|
|
4423
|
-
this.name = 'FirebaseError';
|
|
4424
4424
|
// https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
4425
4425
|
Object.setPrototypeOf(this, MultiFactorError.prototype);
|
|
4426
|
-
this.
|
|
4427
|
-
|
|
4428
|
-
|
|
4429
|
-
|
|
4430
|
-
|
|
4426
|
+
this.customData = {
|
|
4427
|
+
appName: auth.name,
|
|
4428
|
+
tenantId: (_a = auth.tenantId) !== null && _a !== void 0 ? _a : undefined,
|
|
4429
|
+
_serverResponse: error.customData._serverResponse,
|
|
4430
|
+
operationType,
|
|
4431
|
+
};
|
|
4431
4432
|
}
|
|
4432
4433
|
static _fromErrorAndOperation(auth, error, operationType, user) {
|
|
4433
4434
|
return new MultiFactorError(auth, error, operationType, user);
|
|
@@ -5676,16 +5677,17 @@ class MultiFactorResolverImpl {
|
|
|
5676
5677
|
/** @internal */
|
|
5677
5678
|
static _fromError(authExtern, error) {
|
|
5678
5679
|
const auth = _castAuth(authExtern);
|
|
5679
|
-
const
|
|
5680
|
-
|
|
5681
|
-
|
|
5680
|
+
const serverResponse = error.customData._serverResponse;
|
|
5681
|
+
const hints = (serverResponse.mfaInfo || []).map(enrollment => MultiFactorInfoImpl._fromServerResponse(auth, enrollment));
|
|
5682
|
+
_assert(serverResponse.mfaPendingCredential, auth, "internal-error" /* INTERNAL_ERROR */);
|
|
5683
|
+
const session = MultiFactorSessionImpl._fromMfaPendingCredential(serverResponse.mfaPendingCredential);
|
|
5682
5684
|
return new MultiFactorResolverImpl(session, hints, async (assertion) => {
|
|
5683
5685
|
const mfaResponse = await assertion._process(auth, session);
|
|
5684
5686
|
// Clear out the unneeded fields from the old login response
|
|
5685
|
-
delete
|
|
5686
|
-
delete
|
|
5687
|
+
delete serverResponse.mfaInfo;
|
|
5688
|
+
delete serverResponse.mfaPendingCredential;
|
|
5687
5689
|
// Use in the new token & refresh token in the old response
|
|
5688
|
-
const idTokenResponse = Object.assign(Object.assign({},
|
|
5690
|
+
const idTokenResponse = Object.assign(Object.assign({}, serverResponse), { idToken: mfaResponse.idToken, refreshToken: mfaResponse.refreshToken });
|
|
5689
5691
|
// TODO: we should collapse this switch statement into UserCredentialImpl._forOperation and have it support the SIGN_IN case
|
|
5690
5692
|
switch (error.operationType) {
|
|
5691
5693
|
case "signIn" /* SIGN_IN */:
|
|
@@ -5719,8 +5721,8 @@ function getMultiFactorResolver(auth, error) {
|
|
|
5719
5721
|
var _a;
|
|
5720
5722
|
const authModular = getModularInstance(auth);
|
|
5721
5723
|
const errorInternal = error;
|
|
5722
|
-
_assert(error.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
5723
|
-
_assert((_a = errorInternal.
|
|
5724
|
+
_assert(error.customData.operationType, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
5725
|
+
_assert((_a = errorInternal.customData._serverResponse) === null || _a === void 0 ? void 0 : _a.mfaPendingCredential, authModular, "argument-error" /* ARGUMENT_ERROR */);
|
|
5724
5726
|
return MultiFactorResolverImpl._fromError(authModular, errorInternal);
|
|
5725
5727
|
}
|
|
5726
5728
|
|
|
@@ -5843,8 +5845,8 @@ const STORAGE_AVAILABLE_KEY = '__sak';
|
|
|
5843
5845
|
// Both have the same implementation but use a different underlying storage
|
|
5844
5846
|
// object.
|
|
5845
5847
|
class BrowserPersistenceClass {
|
|
5846
|
-
constructor(
|
|
5847
|
-
this.
|
|
5848
|
+
constructor(storageRetriever, type) {
|
|
5849
|
+
this.storageRetriever = storageRetriever;
|
|
5848
5850
|
this.type = type;
|
|
5849
5851
|
}
|
|
5850
5852
|
_isAvailable() {
|
|
@@ -5872,6 +5874,9 @@ class BrowserPersistenceClass {
|
|
|
5872
5874
|
this.storage.removeItem(key);
|
|
5873
5875
|
return Promise.resolve();
|
|
5874
5876
|
}
|
|
5877
|
+
get storage() {
|
|
5878
|
+
return this.storageRetriever();
|
|
5879
|
+
}
|
|
5875
5880
|
}
|
|
5876
5881
|
|
|
5877
5882
|
/**
|
|
@@ -5900,7 +5905,7 @@ const _POLLING_INTERVAL_MS$1 = 1000;
|
|
|
5900
5905
|
const IE10_LOCAL_STORAGE_SYNC_DELAY = 10;
|
|
5901
5906
|
class BrowserLocalPersistence extends BrowserPersistenceClass {
|
|
5902
5907
|
constructor() {
|
|
5903
|
-
super(window.localStorage, "LOCAL" /* LOCAL */);
|
|
5908
|
+
super(() => window.localStorage, "LOCAL" /* LOCAL */);
|
|
5904
5909
|
this.boundEventHandler = (event, poll) => this.onStorageEvent(event, poll);
|
|
5905
5910
|
this.listeners = {};
|
|
5906
5911
|
this.localCache = {};
|
|
@@ -6101,7 +6106,7 @@ const browserLocalPersistence = BrowserLocalPersistence;
|
|
|
6101
6106
|
*/
|
|
6102
6107
|
class BrowserSessionPersistence extends BrowserPersistenceClass {
|
|
6103
6108
|
constructor() {
|
|
6104
|
-
super(window.sessionStorage, "SESSION" /* SESSION */);
|
|
6109
|
+
super(() => window.sessionStorage, "SESSION" /* SESSION */);
|
|
6105
6110
|
}
|
|
6106
6111
|
_addListener(_key, _listener) {
|
|
6107
6112
|
// Listeners are not supported for session storage since it cannot be shared across windows
|
|
@@ -7382,6 +7387,9 @@ class ConfirmationResultImpl {
|
|
|
7382
7387
|
*
|
|
7383
7388
|
* For abuse prevention, this method also requires a {@link ApplicationVerifier}.
|
|
7384
7389
|
* This SDK includes a reCAPTCHA-based implementation, {@link RecaptchaVerifier}.
|
|
7390
|
+
* This function can work on other platforms that do not support the
|
|
7391
|
+
* {@link RecaptchaVerifier} (like React Native), but you need to use a
|
|
7392
|
+
* third-party {@link ApplicationVerifier} implementation.
|
|
7385
7393
|
*
|
|
7386
7394
|
* @example
|
|
7387
7395
|
* ```javascript
|
|
@@ -8120,6 +8128,11 @@ class RedirectAction extends AbstractPopupRedirectOperation {
|
|
|
8120
8128
|
}
|
|
8121
8129
|
redirectOutcomeMap.set(this.auth._key(), readyOutcome);
|
|
8122
8130
|
}
|
|
8131
|
+
// If we're not bypassing auth state, the ready outcome should be set to
|
|
8132
|
+
// null.
|
|
8133
|
+
if (!this.bypassAuthState) {
|
|
8134
|
+
redirectOutcomeMap.set(this.auth._key(), () => Promise.resolve(null));
|
|
8135
|
+
}
|
|
8123
8136
|
return readyOutcome();
|
|
8124
8137
|
}
|
|
8125
8138
|
async onAuthEvent(event) {
|
|
@@ -8147,8 +8160,12 @@ class RedirectAction extends AbstractPopupRedirectOperation {
|
|
|
8147
8160
|
}
|
|
8148
8161
|
async function _getAndClearPendingRedirectStatus(resolver, auth) {
|
|
8149
8162
|
const key = pendingRedirectKey(auth);
|
|
8150
|
-
const
|
|
8151
|
-
await
|
|
8163
|
+
const persistence = resolverPersistence(resolver);
|
|
8164
|
+
if (!(await persistence._isAvailable())) {
|
|
8165
|
+
return false;
|
|
8166
|
+
}
|
|
8167
|
+
const hasPendingRedirect = (await persistence._get(key)) === 'true';
|
|
8168
|
+
await persistence._remove(key);
|
|
8152
8169
|
return hasPendingRedirect;
|
|
8153
8170
|
}
|
|
8154
8171
|
async function _setPendingRedirectStatus(resolver, auth) {
|
|
@@ -8707,7 +8724,8 @@ const IFRAME_ATTRIBUTES = {
|
|
|
8707
8724
|
top: '-100px',
|
|
8708
8725
|
width: '1px',
|
|
8709
8726
|
height: '1px'
|
|
8710
|
-
}
|
|
8727
|
+
},
|
|
8728
|
+
'aria-hidden': 'true'
|
|
8711
8729
|
};
|
|
8712
8730
|
// Map from apiHost to endpoint ID for passing into iframe. In current SDK, apiHost can be set to
|
|
8713
8731
|
// anything (not from a list of endpoints with IDs as in legacy), so this is the closest we can get.
|
|
@@ -9103,7 +9121,7 @@ class PhoneMultiFactorGenerator {
|
|
|
9103
9121
|
PhoneMultiFactorGenerator.FACTOR_ID = 'phone';
|
|
9104
9122
|
|
|
9105
9123
|
var name = "@firebase/auth";
|
|
9106
|
-
var version = "0.
|
|
9124
|
+
var version = "0.19.0-canary.477bdef13";
|
|
9107
9125
|
|
|
9108
9126
|
/**
|
|
9109
9127
|
* @license
|
|
@@ -9293,4 +9311,4 @@ function getAuth(app = getApp()) {
|
|
|
9293
9311
|
registerAuth("Browser" /* BROWSER */);
|
|
9294
9312
|
|
|
9295
9313
|
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, _getRedirectResult as aA, _clearRedirectOutcomes 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, _isIOS7Or8 as ao, debugAssert as ap, _isIOS as aq, _isAndroid as ar, _fail as as, _getRedirectUrl as at, _getProjectConfig as au, _createError as av, _assert as aw, _getInstance as ax, _persistenceKeyName as ay, AuthEventManager 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 };
|
|
9296
|
-
//# sourceMappingURL=index-
|
|
9314
|
+
//# sourceMappingURL=index-030cefd0.js.map
|