@firebase/auth 1.9.1 → 1.10.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/dist/auth-public.d.ts +28 -1
- package/dist/auth.d.ts +40 -2
- package/dist/browser-cjs/{index-018c7ebd.js → index-eddc1dc3.js} +211 -15
- package/dist/browser-cjs/index-eddc1dc3.js.map +1 -0
- package/dist/browser-cjs/index.d.ts +2 -1
- package/dist/browser-cjs/index.js +2 -1
- package/dist/browser-cjs/index.js.map +1 -1
- package/dist/browser-cjs/internal.js +2 -1
- package/dist/browser-cjs/internal.js.map +1 -1
- package/dist/browser-cjs/src/api/index.d.ts +1 -1
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/browser-cjs/src/core/persistence/index.d.ts +2 -1
- package/dist/browser-cjs/src/model/auth.d.ts +4 -1
- package/dist/browser-cjs/src/model/public_types.d.ts +2 -1
- package/dist/browser-cjs/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/browser-cjs/src/platform_node/index.d.ts +1 -0
- package/dist/cordova/auth-cordova-public.d.ts +26 -1
- package/dist/cordova/auth-cordova.d.ts +29 -2
- package/dist/cordova/index.d.ts +2 -1
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +147 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-e795474a.js → popup_redirect-5323ec00.js} +66 -15
- package/dist/cordova/popup_redirect-5323ec00.js.map +1 -0
- package/dist/cordova/src/api/index.d.ts +1 -1
- package/dist/cordova/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/cordova/src/core/persistence/index.d.ts +2 -1
- package/dist/cordova/src/model/auth.d.ts +4 -1
- package/dist/cordova/src/model/public_types.d.ts +2 -1
- package/dist/cordova/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/cordova/src/platform_node/index.d.ts +1 -0
- package/dist/esm2017/{index-e84cf44d.js → index-c92d61ad.js} +211 -16
- package/dist/esm2017/index-c92d61ad.js.map +1 -0
- package/dist/esm2017/index.d.ts +2 -1
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/index.d.ts +1 -1
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/esm2017/src/core/persistence/index.d.ts +2 -1
- package/dist/esm2017/src/model/auth.d.ts +4 -1
- package/dist/esm2017/src/model/public_types.d.ts +2 -1
- package/dist/esm2017/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/esm2017/src/platform_node/index.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.webworker.js +65 -14
- package/dist/index.webworker.js.map +1 -1
- package/dist/node/index.d.ts +2 -1
- package/dist/node/index.js +2 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/internal.js +2 -1
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/api/index.d.ts +1 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/node/src/core/persistence/index.d.ts +2 -1
- package/dist/node/src/model/auth.d.ts +4 -1
- package/dist/node/src/model/public_types.d.ts +2 -1
- package/dist/node/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/node/src/platform_node/index.d.ts +1 -0
- package/dist/node/{totp-06fa6909.js → totp-af329771.js} +68 -15
- package/dist/node/totp-af329771.js.map +1 -0
- package/dist/node-esm/index.d.ts +2 -1
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/api/index.d.ts +1 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/node-esm/src/core/persistence/index.d.ts +2 -1
- package/dist/node-esm/src/model/auth.d.ts +4 -1
- package/dist/node-esm/src/model/public_types.d.ts +2 -1
- package/dist/node-esm/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/node-esm/src/platform_node/index.d.ts +1 -0
- package/dist/node-esm/{totp-d5ff2369.js → totp-7829abf2.js} +68 -16
- package/dist/node-esm/totp-7829abf2.js.map +1 -0
- package/dist/rn/{index-ee081591.js → index-e8d5e0fb.js} +66 -15
- package/dist/rn/index-e8d5e0fb.js.map +1 -0
- package/dist/rn/index.d.ts +2 -1
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +146 -1
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/api/index.d.ts +1 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/rn/src/core/persistence/index.d.ts +2 -1
- package/dist/rn/src/model/auth.d.ts +4 -1
- package/dist/rn/src/model/public_types.d.ts +2 -1
- package/dist/rn/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/rn/src/platform_node/index.d.ts +1 -0
- package/dist/src/api/index.d.ts +1 -1
- package/dist/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/src/core/persistence/index.d.ts +2 -1
- package/dist/src/model/auth.d.ts +4 -1
- package/dist/src/model/public_types.d.ts +2 -1
- package/dist/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/src/platform_node/index.d.ts +1 -0
- package/dist/web-extension-cjs/index.d.ts +2 -1
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +146 -1
- package/dist/web-extension-cjs/internal.js.map +1 -1
- package/dist/web-extension-cjs/{register-c2c7670d.js → register-b64ddc5e.js} +66 -15
- package/dist/web-extension-cjs/register-b64ddc5e.js.map +1 -0
- package/dist/web-extension-cjs/src/api/index.d.ts +1 -1
- package/dist/web-extension-cjs/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/web-extension-cjs/src/core/persistence/index.d.ts +2 -1
- package/dist/web-extension-cjs/src/model/auth.d.ts +4 -1
- package/dist/web-extension-cjs/src/model/public_types.d.ts +2 -1
- package/dist/web-extension-cjs/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/web-extension-cjs/src/platform_node/index.d.ts +1 -0
- package/dist/web-extension-esm2017/auth-web-extension-public.d.ts +26 -1
- package/dist/web-extension-esm2017/auth-web-extension.d.ts +29 -2
- package/dist/web-extension-esm2017/index.d.ts +2 -1
- package/dist/web-extension-esm2017/index.js +2 -2
- package/dist/web-extension-esm2017/internal.js +147 -3
- package/dist/web-extension-esm2017/internal.js.map +1 -1
- package/dist/web-extension-esm2017/{register-31c228e4.js → register-00522d81.js} +66 -15
- package/dist/web-extension-esm2017/register-00522d81.js.map +1 -0
- package/dist/web-extension-esm2017/src/api/index.d.ts +1 -1
- package/dist/web-extension-esm2017/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/web-extension-esm2017/src/core/persistence/index.d.ts +2 -1
- package/dist/web-extension-esm2017/src/model/auth.d.ts +4 -1
- package/dist/web-extension-esm2017/src/model/public_types.d.ts +2 -1
- package/dist/web-extension-esm2017/src/platform_browser/persistence/cookie_storage.d.ts +40 -0
- package/dist/web-extension-esm2017/src/platform_node/index.d.ts +1 -0
- package/package.json +3 -2
- package/dist/browser-cjs/index-018c7ebd.js.map +0 -1
- package/dist/cordova/popup_redirect-e795474a.js.map +0 -1
- package/dist/esm2017/index-e84cf44d.js.map +0 -1
- package/dist/node/totp-06fa6909.js.map +0 -1
- package/dist/node-esm/totp-d5ff2369.js.map +0 -1
- package/dist/rn/index-ee081591.js.map +0 -1
- package/dist/web-extension-cjs/register-c2c7670d.js.map +0 -1
- package/dist/web-extension-esm2017/register-31c228e4.js.map +0 -1
package/dist/cordova/internal.js
CHANGED
|
@@ -1,11 +1,155 @@
|
|
|
1
|
-
import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as Delay, al as _window, am as _assert, an as isV2, ao as _createError, ap as _recaptchaV2ScriptUrl, aq as _loadJS, ar as MockReCaptcha, as as _generateCallbackName, at as _castAuth, au as _isHttpOrHttps, av as _isWorker, aw as getRecaptchaParams, ax as _serverAppCurrentUserOperationNotSupportedError, M as signInWithCredential, ay as _assertLinkedStatus, N as linkWithCredential, Q as reauthenticateWithCredential, az as _initializeRecaptchaConfig, aA as FAKE_TOKEN, aB as startEnrollPhoneMfa, aC as handleRecaptchaFlow, aD as sendPhoneVerificationCode, aE as _link, B as PhoneAuthCredential, aF as _assertInstanceOf, aG as _withDefaultResolver, aH as AbstractPopupRedirectOperation, aI as debugAssert, aJ as _generateEventId, aK as FederatedAuthProvider, aL as _getProjectConfig, aM as _fail, aN as _getCurrentUrl, aO as _gapiScriptUrl, aP as _emulatorUrl, aQ as _isChromeIOS, aR as _isFirefox, aS as _isIOSStandalone, f as browserSessionPersistence, aT as _getRedirectResult, aU as _overrideRedirectResult, aV as _getRedirectUrl, aW as _setWindowLocation, aX as _isMobileBrowser, aY as _isSafari, aZ as _isIOS, a_ as AuthEventManager, a$ as debugFail, b0 as finalizeEnrollPhoneMfa, b1 as startEnrollTotpMfa, b2 as finalizeEnrollTotpMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, j as beforeAuthStateChanged, o as onIdTokenChanged, x as connectAuthEmulator, b3 as _setExternalJSProvider } from './popup_redirect-
|
|
2
|
-
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes, b7 as AuthImpl, E as EmailAuthCredential, D as EmailAuthProvider, G as FacebookAuthProvider, F as FactorId, b9 as FetchProvider, I as GithubAuthProvider, H as GoogleAuthProvider, z as OAuthCredential, J as OAuthProvider, O as OperationType, B as PhoneAuthCredential, P as ProviderId, ba as SAMLAuthCredential, K as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, b5 as UserImpl, am as _assert, at as _castAuth, aM as _fail, aJ as _generateEventId, b8 as _getClientVersion, b6 as _getInstance, aT as _getRedirectResult, aU as _overrideRedirectResult, b4 as _persistenceKeyName, W as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, X as checkActionCode, V as confirmPasswordReset, x as connectAuthEmulator, d as cordovaPopupRedirectResolver, Z as createUserWithEmailAndPassword, q as debugErrorMap, p as deleteUser, a3 as fetchSignInMethodsForEmail, ae as getAdditionalUserInfo, ab as getIdToken, ac as getIdTokenResult, ag as getMultiFactorResolver, g as getRedirectResult, C as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, a1 as isSignInWithEmailLink, N as linkWithCredential, bc as linkWithRedirect, ah as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a7 as parseActionCodeURL, t as prodErrorMap, Q as reauthenticateWithCredential, bd as reauthenticateWithRedirect, af as reload, n as revokeAccessToken, a4 as sendEmailVerification, U as sendPasswordResetEmail, a0 as sendSignInLinkToEmail, s as setPersistence, L as signInAnonymously, M as signInWithCredential, R as signInWithCustomToken, $ as signInWithEmailAndPassword, a2 as signInWithEmailLink, bb as signInWithRedirect, m as signOut, ad as unlink, l as updateCurrentUser, a9 as updateEmail, aa as updatePassword, a8 as updateProfile, u as useDeviceLanguage, v as validatePassword, a5 as verifyBeforeUpdateEmail, Y as verifyPasswordResetCode } from './popup_redirect-
|
|
1
|
+
import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as Delay, al as _window, am as _assert, an as isV2, ao as _createError, ap as _recaptchaV2ScriptUrl, aq as _loadJS, ar as MockReCaptcha, as as _generateCallbackName, at as _castAuth, au as _isHttpOrHttps, av as _isWorker, aw as getRecaptchaParams, ax as _serverAppCurrentUserOperationNotSupportedError, M as signInWithCredential, ay as _assertLinkedStatus, N as linkWithCredential, Q as reauthenticateWithCredential, az as _initializeRecaptchaConfig, aA as FAKE_TOKEN, aB as startEnrollPhoneMfa, aC as handleRecaptchaFlow, aD as sendPhoneVerificationCode, aE as _link, B as PhoneAuthCredential, aF as _assertInstanceOf, aG as _withDefaultResolver, aH as AbstractPopupRedirectOperation, aI as debugAssert, aJ as _generateEventId, aK as FederatedAuthProvider, aL as _getProjectConfig, aM as _fail, aN as _getCurrentUrl, aO as _gapiScriptUrl, aP as _emulatorUrl, aQ as _isChromeIOS, aR as _isFirefox, aS as _isIOSStandalone, f as browserSessionPersistence, aT as _getRedirectResult, aU as _overrideRedirectResult, aV as _getRedirectUrl, aW as _setWindowLocation, aX as _isMobileBrowser, aY as _isSafari, aZ as _isIOS, a_ as AuthEventManager, a$ as debugFail, b0 as finalizeEnrollPhoneMfa, b1 as startEnrollTotpMfa, b2 as finalizeEnrollTotpMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, j as beforeAuthStateChanged, o as onIdTokenChanged, x as connectAuthEmulator, b3 as _setExternalJSProvider } from './popup_redirect-5323ec00.js';
|
|
2
|
+
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes, b7 as AuthImpl, E as EmailAuthCredential, D as EmailAuthProvider, G as FacebookAuthProvider, F as FactorId, b9 as FetchProvider, I as GithubAuthProvider, H as GoogleAuthProvider, z as OAuthCredential, J as OAuthProvider, O as OperationType, B as PhoneAuthCredential, P as ProviderId, ba as SAMLAuthCredential, K as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, b5 as UserImpl, am as _assert, at as _castAuth, aM as _fail, aJ as _generateEventId, b8 as _getClientVersion, b6 as _getInstance, aT as _getRedirectResult, aU as _overrideRedirectResult, b4 as _persistenceKeyName, W as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, X as checkActionCode, V as confirmPasswordReset, x as connectAuthEmulator, d as cordovaPopupRedirectResolver, Z as createUserWithEmailAndPassword, q as debugErrorMap, p as deleteUser, a3 as fetchSignInMethodsForEmail, ae as getAdditionalUserInfo, ab as getIdToken, ac as getIdTokenResult, ag as getMultiFactorResolver, g as getRedirectResult, C as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, a1 as isSignInWithEmailLink, N as linkWithCredential, bc as linkWithRedirect, ah as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a7 as parseActionCodeURL, t as prodErrorMap, Q as reauthenticateWithCredential, bd as reauthenticateWithRedirect, af as reload, n as revokeAccessToken, a4 as sendEmailVerification, U as sendPasswordResetEmail, a0 as sendSignInLinkToEmail, s as setPersistence, L as signInAnonymously, M as signInWithCredential, R as signInWithCustomToken, $ as signInWithEmailAndPassword, a2 as signInWithEmailLink, bb as signInWithRedirect, m as signOut, ad as unlink, l as updateCurrentUser, a9 as updateEmail, aa as updatePassword, a8 as updateProfile, u as useDeviceLanguage, v as validatePassword, a5 as verifyBeforeUpdateEmail, Y as verifyPasswordResetCode } from './popup_redirect-5323ec00.js';
|
|
3
3
|
import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
4
4
|
import { _isFirebaseServerApp, SDK_VERSION, _getProvider, getApp } from '@firebase/app';
|
|
5
5
|
import 'tslib';
|
|
6
6
|
import '@firebase/component';
|
|
7
7
|
import '@firebase/logger';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @license
|
|
11
|
+
* Copyright 2025 Google LLC
|
|
12
|
+
*
|
|
13
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
* you may not use this file except in compliance with the License.
|
|
15
|
+
* You may obtain a copy of the License at
|
|
16
|
+
*
|
|
17
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
*
|
|
19
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
* See the License for the specific language governing permissions and
|
|
23
|
+
* limitations under the License.
|
|
24
|
+
*/
|
|
25
|
+
const POLLING_INTERVAL_MS = 1000;
|
|
26
|
+
// Pull a cookie value from document.cookie
|
|
27
|
+
function getDocumentCookie(name) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
const escapedName = name.replace(/[\\^$.*+?()[\]{}|]/g, '\\$&');
|
|
30
|
+
const matcher = RegExp(`${escapedName}=([^;]+)`);
|
|
31
|
+
return (_b = (_a = document.cookie.match(matcher)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : null;
|
|
32
|
+
}
|
|
33
|
+
// Produce a sanitized cookie name from the persistence key
|
|
34
|
+
function getCookieName(key) {
|
|
35
|
+
// __HOST- doesn't work in localhost https://issues.chromium.org/issues/40196122 but it has
|
|
36
|
+
// desirable security properties, so lets use a different cookie name while in dev-mode.
|
|
37
|
+
// Already checked isSecureContext in _isAvailable, so if it's http we're hitting local.
|
|
38
|
+
const isDevMode = window.location.protocol === 'http:';
|
|
39
|
+
return `${isDevMode ? '__dev_' : '__HOST-'}FIREBASE_${key.split(':')[3]}`;
|
|
40
|
+
}
|
|
41
|
+
class CookiePersistence {
|
|
42
|
+
constructor() {
|
|
43
|
+
this.type = "COOKIE" /* PersistenceType.COOKIE */;
|
|
44
|
+
this.listenerUnsubscribes = new Map();
|
|
45
|
+
}
|
|
46
|
+
// used to get the URL to the backend to proxy to
|
|
47
|
+
_getFinalTarget(originalUrl) {
|
|
48
|
+
if (typeof window === undefined) {
|
|
49
|
+
return originalUrl;
|
|
50
|
+
}
|
|
51
|
+
const url = new URL(`${window.location.origin}/__cookies__`);
|
|
52
|
+
url.searchParams.set('finalTarget', originalUrl);
|
|
53
|
+
return url;
|
|
54
|
+
}
|
|
55
|
+
// To be a usable persistence method in a chain browserCookiePersistence ensures that
|
|
56
|
+
// prerequisites have been met, namely that we're in a secureContext, navigator and document are
|
|
57
|
+
// available and cookies are enabled. Not all UAs support these method, so fallback accordingly.
|
|
58
|
+
async _isAvailable() {
|
|
59
|
+
var _a;
|
|
60
|
+
if (typeof isSecureContext === 'boolean' && !isSecureContext) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
if (typeof navigator === 'undefined' || typeof document === 'undefined') {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
return (_a = navigator.cookieEnabled) !== null && _a !== void 0 ? _a : true;
|
|
67
|
+
}
|
|
68
|
+
// Set should be a noop as we expect middleware to handle this
|
|
69
|
+
async _set(_key, _value) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Attempt to get the cookie from cookieStore, fallback to document.cookie
|
|
73
|
+
async _get(key) {
|
|
74
|
+
if (!this._isAvailable()) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const name = getCookieName(key);
|
|
78
|
+
if (window.cookieStore) {
|
|
79
|
+
const cookie = await window.cookieStore.get(name);
|
|
80
|
+
return cookie === null || cookie === void 0 ? void 0 : cookie.value;
|
|
81
|
+
}
|
|
82
|
+
return getDocumentCookie(name);
|
|
83
|
+
}
|
|
84
|
+
// Log out by overriding the idToken with a sentinel value of ""
|
|
85
|
+
async _remove(key) {
|
|
86
|
+
if (!this._isAvailable()) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// To make sure we don't hit signout over and over again, only do this operation if we need to
|
|
90
|
+
// with the logout sentinel value of "" this can cause race conditions. Unnecessary set-cookie
|
|
91
|
+
// headers will reduce CDN hit rates too.
|
|
92
|
+
const existingValue = await this._get(key);
|
|
93
|
+
if (!existingValue) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const name = getCookieName(key);
|
|
97
|
+
document.cookie = `${name}=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;Priority=High`;
|
|
98
|
+
await fetch(`/__cookies__`, { method: 'DELETE' }).catch(() => undefined);
|
|
99
|
+
}
|
|
100
|
+
// Listen for cookie changes, both cookieStore and fallback to polling document.cookie
|
|
101
|
+
_addListener(key, listener) {
|
|
102
|
+
if (!this._isAvailable()) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const name = getCookieName(key);
|
|
106
|
+
if (window.cookieStore) {
|
|
107
|
+
const cb = ((event) => {
|
|
108
|
+
const changedCookie = event.changed.find(change => change.name === name);
|
|
109
|
+
if (changedCookie) {
|
|
110
|
+
listener(changedCookie.value);
|
|
111
|
+
}
|
|
112
|
+
const deletedCookie = event.deleted.find(change => change.name === name);
|
|
113
|
+
if (deletedCookie) {
|
|
114
|
+
listener(null);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
const unsubscribe = () => window.cookieStore.removeEventListener('change', cb);
|
|
118
|
+
this.listenerUnsubscribes.set(listener, unsubscribe);
|
|
119
|
+
return window.cookieStore.addEventListener('change', cb);
|
|
120
|
+
}
|
|
121
|
+
let lastValue = getDocumentCookie(name);
|
|
122
|
+
const interval = setInterval(() => {
|
|
123
|
+
const currentValue = getDocumentCookie(name);
|
|
124
|
+
if (currentValue !== lastValue) {
|
|
125
|
+
listener(currentValue);
|
|
126
|
+
lastValue = currentValue;
|
|
127
|
+
}
|
|
128
|
+
}, POLLING_INTERVAL_MS);
|
|
129
|
+
const unsubscribe = () => clearInterval(interval);
|
|
130
|
+
this.listenerUnsubscribes.set(listener, unsubscribe);
|
|
131
|
+
}
|
|
132
|
+
_removeListener(_key, listener) {
|
|
133
|
+
const unsubscribe = this.listenerUnsubscribes.get(listener);
|
|
134
|
+
if (!unsubscribe) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
unsubscribe();
|
|
138
|
+
this.listenerUnsubscribes.delete(listener);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
CookiePersistence.type = 'COOKIE';
|
|
142
|
+
/**
|
|
143
|
+
* An implementation of {@link Persistence} of type `COOKIE`, for use on the client side in
|
|
144
|
+
* applications leveraging hybrid rendering and middleware.
|
|
145
|
+
*
|
|
146
|
+
* @remarks This persistence method requires companion middleware to function, such as that provided
|
|
147
|
+
* by {@link https://firebaseopensource.com/projects/firebaseextended/reactfire/ | ReactFire} for
|
|
148
|
+
* NextJS.
|
|
149
|
+
* @beta
|
|
150
|
+
*/
|
|
151
|
+
const browserCookiePersistence = CookiePersistence;
|
|
152
|
+
|
|
9
153
|
/**
|
|
10
154
|
* @license
|
|
11
155
|
* Copyright 2020 Google LLC
|
|
@@ -1845,5 +1989,5 @@ function addFrameworkForLogging(auth, framework) {
|
|
|
1845
1989
|
_castAuth(auth)._logFramework(framework);
|
|
1846
1990
|
}
|
|
1847
1991
|
|
|
1848
|
-
export { AuthPopup, PhoneAuthProvider, PhoneMultiFactorGenerator, RecaptchaVerifier, TotpMultiFactorGenerator, TotpSecret, addFrameworkForLogging, browserPopupRedirectResolver, getAuth, linkWithPhoneNumber, linkWithPopup, reauthenticateWithPhoneNumber, reauthenticateWithPopup, signInWithPhoneNumber, signInWithPopup, updatePhoneNumber };
|
|
1992
|
+
export { AuthPopup, PhoneAuthProvider, PhoneMultiFactorGenerator, RecaptchaVerifier, TotpMultiFactorGenerator, TotpSecret, addFrameworkForLogging, browserCookiePersistence, browserPopupRedirectResolver, getAuth, linkWithPhoneNumber, linkWithPopup, reauthenticateWithPhoneNumber, reauthenticateWithPopup, signInWithPhoneNumber, signInWithPopup, updatePhoneNumber };
|
|
1849
1993
|
//# sourceMappingURL=internal.js.map
|