@firebase/auth 1.7.5 → 1.7.6-canary.08bb87b9f
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/README.md +1 -1
- package/dist/auth-public.d.ts +4 -4
- package/dist/auth.d.ts +4 -4
- package/dist/browser-cjs/{index-22b094f0.js → index-f068d89b.js} +12 -49
- package/dist/browser-cjs/index-f068d89b.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/internal.js +5 -5
- package/dist/browser-cjs/internal.js.map +1 -1
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/browser-cjs/src/core/providers/github.d.ts +4 -4
- package/dist/browser-cjs/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/browser-cjs/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/browser-cjs/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/browser-cjs/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/cordova/auth-cordova-public.d.ts +4 -4
- package/dist/cordova/auth-cordova.d.ts +4 -4
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +4 -4
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-31aa6bae.js → popup_redirect-c40b6c29.js} +13 -50
- package/dist/cordova/popup_redirect-c40b6c29.js.map +1 -0
- package/dist/cordova/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/cordova/src/core/providers/github.d.ts +4 -4
- package/dist/cordova/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/cordova/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/cordova/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/cordova/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/esm2017/{index-54738136.js → index-4398bf28.js} +12 -49
- package/dist/esm2017/index-4398bf28.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +6 -6
- package/dist/esm2017/internal.js.map +1 -1
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm2017/src/core/providers/github.d.ts +4 -4
- package/dist/esm2017/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/esm2017/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/esm2017/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/esm2017/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/esm5/{index-5a49f2c0.js → index-9c402d1b.js} +11 -48
- package/dist/esm5/index-9c402d1b.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +6 -6
- package/dist/esm5/internal.js.map +1 -1
- package/dist/esm5/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/esm5/src/core/providers/github.d.ts +4 -4
- package/dist/esm5/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/esm5/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/esm5/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/esm5/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/index.webworker.esm5.js +8 -8
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +5 -32
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node/src/core/providers/github.d.ts +4 -4
- package/dist/node/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/node/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/node/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/node/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/node/{totp-721eac4b.js → totp-c913d6a8.js} +8 -20
- package/dist/node/totp-c913d6a8.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +8 -35
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/node-esm/src/core/providers/github.d.ts +4 -4
- package/dist/node-esm/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/node-esm/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/node-esm/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/node-esm/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/node-esm/{totp-3675c216.js → totp-82daeec5.js} +9 -19
- package/dist/node-esm/totp-82daeec5.js.map +1 -0
- package/dist/rn/{index-d345c8d7.js → index-499673c8.js} +9 -20
- package/dist/rn/index-499673c8.js.map +1 -0
- package/dist/rn/index.js +2 -2
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/internal.js +7 -34
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/rn/src/core/providers/github.d.ts +4 -4
- package/dist/rn/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/rn/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/rn/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/rn/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/src/core/providers/github.d.ts +4 -4
- package/dist/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +8 -35
- package/dist/web-extension-cjs/internal.js.map +1 -1
- package/dist/web-extension-cjs/{register-6b27d5d8.js → register-7f3bef7e.js} +9 -20
- package/dist/web-extension-cjs/register-7f3bef7e.js.map +1 -0
- package/dist/web-extension-cjs/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/web-extension-cjs/src/core/providers/github.d.ts +4 -4
- package/dist/web-extension-cjs/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/web-extension-cjs/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/web-extension-cjs/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/web-extension-cjs/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/dist/web-extension-esm2017/auth-web-extension-public.d.ts +4 -4
- package/dist/web-extension-esm2017/auth-web-extension.d.ts +4 -4
- package/dist/web-extension-esm2017/index.js +2 -2
- package/dist/web-extension-esm2017/internal.js +10 -37
- package/dist/web-extension-esm2017/internal.js.map +1 -1
- package/dist/web-extension-esm2017/{register-83348242.js → register-e842a4a6.js} +10 -20
- package/dist/web-extension-esm2017/register-e842a4a6.js.map +1 -0
- package/dist/web-extension-esm2017/src/core/auth/auth_impl.d.ts +1 -1
- package/dist/web-extension-esm2017/src/core/providers/github.d.ts +4 -4
- package/dist/web-extension-esm2017/src/platform_browser/messagechannel/receiver.d.ts +1 -1
- package/dist/web-extension-esm2017/src/platform_cordova/popup_redirect/events.d.ts +1 -1
- package/dist/web-extension-esm2017/test/integration/webdriver/util/auth_driver.d.ts +1 -1
- package/dist/web-extension-esm2017/test/integration/webdriver/util/idp_page.d.ts +1 -1
- package/package.json +6 -6
- package/dist/browser-cjs/index-22b094f0.js.map +0 -1
- package/dist/cordova/popup_redirect-31aa6bae.js.map +0 -1
- package/dist/esm2017/index-54738136.js.map +0 -1
- package/dist/esm5/index-5a49f2c0.js.map +0 -1
- package/dist/node/totp-721eac4b.js.map +0 -1
- package/dist/node-esm/totp-3675c216.js.map +0 -1
- package/dist/rn/index-d345c8d7.js.map +0 -1
- package/dist/web-extension-cjs/register-6b27d5d8.js.map +0 -1
- package/dist/web-extension-esm2017/register-83348242.js.map +0 -1
package/dist/rn/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var app = require('@firebase/app');
|
|
6
|
-
var index = require('./index-
|
|
6
|
+
var index = require('./index-499673c8.js');
|
|
7
7
|
var tslib = require('tslib');
|
|
8
8
|
require('@firebase/util');
|
|
9
9
|
require('@firebase/component');
|
|
@@ -39,7 +39,7 @@ function getReactNativePersistence(storage) {
|
|
|
39
39
|
// be able to be instantiated (as a class) using "new". That function also
|
|
40
40
|
// expects the constructor to be empty. Since ReactNativeStorage requires the
|
|
41
41
|
// underlying storage layer, we need to be able to create subclasses
|
|
42
|
-
// (closures,
|
|
42
|
+
// (closures, essentially) that have the storage layer but empty constructor.
|
|
43
43
|
return _a = /** @class */ (function () {
|
|
44
44
|
function class_1() {
|
|
45
45
|
this.type = "LOCAL" /* PersistenceType.LOCAL */;
|
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 object that wraps `AsyncStorage` imported from\n * `react-native` or `@react-native-community/async-storage`, and can\n * be used in the persistence dependency field in {@link initializeAuth}.\n *\n * @public\n */\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\n // In the _getInstance() implementation (see src/core/persistence/index.ts),\n // we expect each \"externs.Persistence\" object passed to us by the user to\n // be able to be instantiated (as a class) using \"new\". That function also\n // expects the constructor to be empty. Since ReactNativeStorage requires the\n // underlying storage layer, we need to be able to create subclasses\n // (closures,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/platform_react_native/persistence/react_native.ts","../../index.rn.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Persistence, ReactNativeAsyncStorage } from '../../model/public_types';\n\nimport {\n PersistenceInternal,\n PersistenceType,\n PersistenceValue,\n STORAGE_AVAILABLE_KEY,\n StorageEventListener\n} from '../../core/persistence';\n\n/**\n * Returns a persistence object that wraps `AsyncStorage` imported from\n * `react-native` or `@react-native-community/async-storage`, and can\n * be used in the persistence dependency field in {@link initializeAuth}.\n *\n * @public\n */\nexport function getReactNativePersistence(\n storage: ReactNativeAsyncStorage\n): Persistence {\n // In the _getInstance() implementation (see src/core/persistence/index.ts),\n // we expect each \"externs.Persistence\" object passed to us by the user to\n // be able to be instantiated (as a class) using \"new\". That function also\n // expects the constructor to be empty. Since ReactNativeStorage requires the\n // underlying storage layer, we need to be able to create subclasses\n // (closures, essentially) that have the storage layer but empty constructor.\n return class implements PersistenceInternal {\n static type: 'LOCAL' = 'LOCAL';\n readonly type: PersistenceType = PersistenceType.LOCAL;\n\n async _isAvailable(): Promise<boolean> {\n try {\n if (!storage) {\n return false;\n }\n await storage.setItem(STORAGE_AVAILABLE_KEY, '1');\n await storage.removeItem(STORAGE_AVAILABLE_KEY);\n return true;\n } catch {\n return false;\n }\n }\n\n _set(key: string, value: PersistenceValue): Promise<void> {\n return storage.setItem(key, JSON.stringify(value));\n }\n\n async _get<T extends PersistenceValue>(key: string): Promise<T | null> {\n const json = await storage.getItem(key);\n return json ? JSON.parse(json) : null;\n }\n\n _remove(key: string): Promise<void> {\n return storage.removeItem(key);\n }\n\n _addListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n\n _removeListener(_key: string, _listener: StorageEventListener): void {\n // Listeners are not supported for React Native storage.\n return;\n }\n };\n}\n","/**\n * @license\n * Copyright 2017 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * This is the file that people using React Native will actually import. You\n * should only include this file if you have something specific about your\n * implementation that mandates having a separate entrypoint. Otherwise you can\n * just use index.ts\n */\n\nimport { FirebaseApp, getApp, _getProvider } from '@firebase/app';\nimport { Auth, Dependencies } from './src/model/public_types';\n\nimport { initializeAuth as initializeAuthOriginal } from './src';\nimport { registerAuth } from './src/core/auth/register';\nimport { ClientPlatform } from './src/core/util/version';\nimport { _logWarn } from './src/core/util/log';\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';\nexport {\n TotpMultiFactorGenerator,\n TotpSecret\n} from './src/mfa/assertions/totp';\n\nexport { getReactNativePersistence } from './src/platform_react_native/persistence/react_native';\n\nconst NO_PERSISTENCE_WARNING = `\nYou are initializing Firebase Auth for React Native without providing\nAsyncStorage. Auth state will default to memory persistence and will not\npersist between sessions. In order to persist auth state, install the package\n\"@react-native-async-storage/async-storage\" and provide it to\ninitializeAuth:\n\nimport { initializeAuth, getReactNativePersistence } from 'firebase/auth';\nimport ReactNativeAsyncStorage from '@react-native-async-storage/async-storage';\nconst auth = initializeAuth(app, {\n persistence: getReactNativePersistence(ReactNativeAsyncStorage)\n});\n`;\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 // Only warn if getAuth() is called before initializeAuth()\n _logWarn(NO_PERSISTENCE_WARNING);\n\n return initializeAuthOriginal(app);\n}\n\n/**\n * Wrapper around base `initializeAuth()` for RN users only, which\n * shows the warning message if no persistence is provided.\n * Double-checked potential collision with `export * from './index.shared'`\n * as `./index.shared` also exports `initializeAuth()`, and the final\n * bundle does correctly export only this `initializeAuth()` function\n * and not the one from index.shared.\n */\nexport function initializeAuth(app: FirebaseApp, deps?: Dependencies): Auth {\n if (!deps?.persistence) {\n _logWarn(NO_PERSISTENCE_WARNING);\n }\n return initializeAuthOriginal(app, deps);\n}\n\nregisterAuth(ClientPlatform.REACT_NATIVE);\n"],"names":["STORAGE_AVAILABLE_KEY","app","getApp","_getProvider","_logWarn","initializeAuthOriginal","registerAuth"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAYH;;;;;;AAMG;AACG,SAAU,yBAAyB,CACvC,OAAgC,EAAA;;;;;;;;AAQhC,IAAA,OAAA,EAAA,kBAAA,YAAA;AAAO,YAAA,SAAA,OAAA,GAAA;AAEI,gBAAA,IAAA,CAAA,IAAI,GAA0C,OAAA,6BAAA;aAqCxD;AAnCO,YAAA,OAAA,CAAA,SAAA,CAAA,YAAY,GAAlB,YAAA;;;;;;gCAEI,IAAI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|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-499673c8.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -84,10 +84,6 @@ var BrowserPersistenceClass = /** @class */ (function () {
|
|
|
84
84
|
* See the License for the specific language governing permissions and
|
|
85
85
|
* limitations under the License.
|
|
86
86
|
*/
|
|
87
|
-
function _iframeCannotSyncWebStorage() {
|
|
88
|
-
var ua = util.getUA();
|
|
89
|
-
return index._isSafari(ua) || index._isIOS(ua);
|
|
90
|
-
}
|
|
91
87
|
// The polling period in case events are not supported
|
|
92
88
|
var _POLLING_INTERVAL_MS$1 = 1000;
|
|
93
89
|
// The IE 10 localStorage cross tab synchronization delay in milliseconds
|
|
@@ -102,8 +98,6 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
|
102
98
|
// setTimeout return value is platform specific
|
|
103
99
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
104
100
|
_this.pollTimer = null;
|
|
105
|
-
// Safari or iOS browser and embedded in an iframe.
|
|
106
|
-
_this.safariLocalStorageNotSynced = _iframeCannotSyncWebStorage() && index._isIframe();
|
|
107
101
|
// Whether to use polling instead of depending on window events
|
|
108
102
|
_this.fallbackToPolling = index._isMobileBrowser();
|
|
109
103
|
_this._shouldAllowMigration = true;
|
|
@@ -146,27 +140,6 @@ var BrowserLocalPersistence = /** @class */ (function (_super) {
|
|
|
146
140
|
// Remove polling listener to prevent possible event duplication.
|
|
147
141
|
this.stopPolling();
|
|
148
142
|
}
|
|
149
|
-
// Safari embedded iframe. Storage event will trigger with the delta
|
|
150
|
-
// changes but no changes will be applied to the iframe localStorage.
|
|
151
|
-
if (this.safariLocalStorageNotSynced) {
|
|
152
|
-
// Get current iframe page value.
|
|
153
|
-
var storedValue_1 = this.storage.getItem(key);
|
|
154
|
-
// Value not synchronized, synchronize manually.
|
|
155
|
-
if (event.newValue !== storedValue_1) {
|
|
156
|
-
if (event.newValue !== null) {
|
|
157
|
-
// Value changed from current value.
|
|
158
|
-
this.storage.setItem(key, event.newValue);
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
// Current value deleted.
|
|
162
|
-
this.storage.removeItem(key);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
else if (this.localCache[key] === event.newValue && !poll) {
|
|
166
|
-
// Already detected and processed, do not trigger listeners again.
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
143
|
var triggerListeners = function () {
|
|
171
144
|
// Keep local map up to date in case storage event is triggered before
|
|
172
145
|
// poll.
|
|
@@ -514,7 +487,7 @@ var Receiver = /** @class */ (function () {
|
|
|
514
487
|
* Unsubscribe an event handler from a particular event.
|
|
515
488
|
*
|
|
516
489
|
* @param eventType - Event name to unsubscribe from.
|
|
517
|
-
* @param eventHandler -
|
|
490
|
+
* @param eventHandler - Optional event handler, if none provided, unsubscribe all handlers on this event.
|
|
518
491
|
*
|
|
519
492
|
*/
|
|
520
493
|
Receiver.prototype._unsubscribe = function (eventType, eventHandler) {
|
|
@@ -2412,7 +2385,7 @@ function matchDomain(expected) {
|
|
|
2412
2385
|
*/
|
|
2413
2386
|
var NETWORK_TIMEOUT = new index.Delay(30000, 60000);
|
|
2414
2387
|
/**
|
|
2415
|
-
* Reset
|
|
2388
|
+
* Reset unloaded GApi modules. If gapi.load fails due to a network error,
|
|
2416
2389
|
* it will stop working after a retrial. This is a hack to fix this issue.
|
|
2417
2390
|
*/
|
|
2418
2391
|
function resetUnloadedGapiModules() {
|
|
@@ -3233,7 +3206,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
3233
3206
|
if (typeof closeBrowserTab === 'function') {
|
|
3234
3207
|
closeBrowserTab();
|
|
3235
3208
|
}
|
|
3236
|
-
// Close inappbrowser
|
|
3209
|
+
// Close inappbrowser embedded webview in iOS7 and 8 case if still
|
|
3237
3210
|
// open.
|
|
3238
3211
|
if (typeof (iabRef === null || iabRef === void 0 ? void 0 : iabRef.close) === 'function') {
|
|
3239
3212
|
iabRef.close();
|
|
@@ -3245,7 +3218,7 @@ function _waitForAppResume(auth, eventListener, iabRef) {
|
|
|
3245
3218
|
return;
|
|
3246
3219
|
}
|
|
3247
3220
|
onCloseTimer = window.setTimeout(function () {
|
|
3248
|
-
// Wait two
|
|
3221
|
+
// Wait two seconds after resume then reject.
|
|
3249
3222
|
reject(index._createError(auth, "redirect-cancelled-by-user" /* AuthErrorCode.REDIRECT_CANCELLED_BY_USER */));
|
|
3250
3223
|
}, REDIRECT_TIMEOUT_MS);
|
|
3251
3224
|
}
|
|
@@ -3375,7 +3348,7 @@ var CordovaAuthEventManager = /** @class */ (function (_super) {
|
|
|
3375
3348
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
3376
3349
|
_this.passiveListeners = new Set();
|
|
3377
3350
|
_this.initPromise = new Promise(function (resolve) {
|
|
3378
|
-
_this.
|
|
3351
|
+
_this.resolveInitialized = resolve;
|
|
3379
3352
|
});
|
|
3380
3353
|
return _this;
|
|
3381
3354
|
}
|
|
@@ -3393,7 +3366,7 @@ var CordovaAuthEventManager = /** @class */ (function (_super) {
|
|
|
3393
3366
|
};
|
|
3394
3367
|
/** Override the onEvent method */
|
|
3395
3368
|
CordovaAuthEventManager.prototype.onEvent = function (event) {
|
|
3396
|
-
this.
|
|
3369
|
+
this.resolveInitialized();
|
|
3397
3370
|
this.passiveListeners.forEach(function (cb) { return cb(event); });
|
|
3398
3371
|
return _super.prototype.onEvent.call(this, event);
|
|
3399
3372
|
};
|