New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/auth-compat

Package Overview
Dependencies
Maintainers
5
Versions
1262
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/auth-compat - npm Package Compare versions

Comparing version 0.0.900-exp.f18a6d41d to 0.0.900-exp.f8e97019f

dist/auth-compat-exp/index.d.ts

2

dist/firebase-auth.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/auth/internal"),require("@firebase/auth-types"),require("@firebase/app-types")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/auth/internal","@firebase/auth-types","@firebase/app-types"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.impl)}(this,function(K,Y){"use strict";try{(function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=e(K),r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function u(e,u,s,a){return new(s=s||Promise)(function(r,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function i(e){try{o(a.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(n,i)}o((a=a.apply(e,u||[])).next())})}function s(r,n){var i,o,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(u=2&t[0]?o.return:t[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,t[1])).done)return u;switch(o=0,u&&(t=[2&t[0],u.value]),t[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){s.label=t[1];break}if(6===t[0]&&s.label<u[1]){s.label=u[1],u=t;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(t);break}u[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(r,s)}catch(e){t=[6,e],o=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function n(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function o(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}function a(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function c(){return"indexedDB"in self&&null!=indexedDB}var p,t,h,d="FirebaseError",f=(p=Error,r(t=y,h=p),t.prototype=null===h?Object.create(h):(l.prototype=h.prototype,new l),y);function l(){this.constructor=t}function y(e,t,r){t=p.call(this,t)||this;return t.code=e,t.customData=r,t.name=d,Object.setPrototypeOf(t,y.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,v.prototype.create),t}var v=(m.prototype.create=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n,i=t[0]||{},o=this.service+"/"+e,e=this.errors[e],e=e?(n=i,e.replace(b,function(e,t){var r=n[t];return null!=r?String(r):"<"+t+"?>"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new f(o,e,i)},m);function m(e,t,r){this.service=e,this.serviceName=t,this.errors=r}var b=/\{\$([^}]+)}/g,g=(P.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},P.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},P.prototype.setServiceProps=function(e){return this.serviceProps=e,this},P);function P(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}function I(){var e;return(null===(e=null===self||void 0===self?void 0:self.location)||void 0===e?void 0:e.protocol)||null}function E(){return(0<=(e=n()).indexOf("MSIE ")||0<=e.indexOf("Trident/"))&&11===(null===document||void 0===document?void 0:document.documentMode);var e}function R(e){return void 0===e&&(e=n()),E()||(void 0===(e=e)&&(e=n()),/Edge\/\d+/.test(e))}function A(){try{var e=self.localStorage,t=Y._generateEventId();if(e)return e.setItem(t,"1"),e.removeItem(t),!R()||c()}catch(e){return w()&&c()}return!1}function w(){return"undefined"!=typeof global&&"WorkerGlobalScope"in global&&"importScripts"in global}function O(){return("http:"===I()||"https:"===I()||"object"==typeof(t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0)&&void 0!==t.id||(void 0===e&&(e=n()),!("file:"!==I()&&"ionic:"!==I()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))))&&!(a()||o())&&A()&&!w();var e,t}var N={LOCAL:"LOCAL",NONE:"NONE",SESSION:"SESSION"};function S(i,o){return u(this,void 0,void 0,function(){var t,r,n;return s(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o];case 1:return t=e.sent(),[3,3];case 2:throw"auth/multi-factor-auth-required"===(r=e.sent()).code&&(r.resolver=Y.getMultiFactorResolver(i,r)),r;case 3:return[4,t];case 4:return n=e.sent(),r=n.operationType,n=n.user,[2,{operationType:r,credential:function(e){var t=e.providerId;if(!(o=e._tokenResponse))return null;if("temporaryProof"in o&&"phoneNumber"in o)return Y.PhoneAuthProvider.credentialFromResult(e);if(!t||"password"===t)return null;switch(t){case"google.com":return Y.GoogleAuthProvider.credentialFromResult(e);case"facebook.com":return Y.FacebookAuthProvider.credentialFromResult(e);case"github.com":return Y.GithubAuthProvider.credentialFromResult(e);case"twitter.com":return Y.TwitterAuthProvider.credentialFromResult(e);default:var r=o.oauthIdToken,n=o.oauthAccessToken,i=o.oauthTokenSecret,e=o.pendingToken,o=o.nonce;return n||i||r||e?new Y.OAuthProvider(t).credential({idToken:r,accessToken:n,rawNonce:o}):null}}(t),additionalUserInfo:Y.getAdditionalUserInfo(t),user:C.getOrCreate(n)}]}})})}function _(r,n){return u(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return[4,n];case 1:return[2,{verificationId:(t=e.sent()).verificationId,confirm:function(e){return S(r,t.confirm(e))}}]}})})}function k(e){return e.unwrap()}var C=(W.getOrCreate=function(e){return W.USER_MAP.has(e)||W.USER_MAP.set(e,new W(e)),W.USER_MAP.get(e)},W.prototype.delete=function(){return this.user.delete()},W.prototype.reload=function(){return this.user.reload()},W.prototype.toJSON=function(){return this.user.toJSON()},W.prototype.getIdTokenResult=function(e){return this.user.getIdTokenResult(e)},W.prototype.getIdToken=function(e){return this.user.getIdToken(e)},W.prototype.linkAndRetrieveDataWithCredential=function(e){return this.linkWithCredential(e)},W.prototype.linkWithCredential=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,S(this.auth,Y.linkWithCredential(this.user,t))]})})},W.prototype.linkWithPhoneNumber=function(t,r){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,_(this.auth,Y.linkWithPhoneNumber(this.user,t,k(r)))]})})},W.prototype.linkWithPopup=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,S(this.auth,Y.linkWithPopup(this.user,t,Y.browserPopupRedirectResolver))]})})},W.prototype.linkWithRedirect=function(e){return Y.linkWithRedirect(this.user,e,Y.browserPopupRedirectResolver)},W.prototype.reauthenticateAndRetrieveDataWithCredential=function(e){return this.reauthenticateWithCredential(e)},W.prototype.reauthenticateWithCredential=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,S(this.auth,Y.reauthenticateWithCredential(this.user,t))]})})},W.prototype.reauthenticateWithPhoneNumber=function(e,t){return _(this.auth,Y.reauthenticateWithPhoneNumber(this.user,e,k(t)))},W.prototype.reauthenticateWithPopup=function(e){return S(this.auth,Y.reauthenticateWithPopup(this.user,e,Y.browserPopupRedirectResolver))},W.prototype.reauthenticateWithRedirect=function(e){return Y.reauthenticateWithRedirect(this.user,e,Y.browserPopupRedirectResolver)},W.prototype.sendEmailVerification=function(e){return Y.sendEmailVerification(this.user,e)},W.prototype.unlink=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,Y.unlink(this.user,t)];case 1:return e.sent(),[2,this]}})})},W.prototype.updateEmail=function(e){return Y.updateEmail(this.user,e)},W.prototype.updatePassword=function(e){return Y.updatePassword(this.user,e)},W.prototype.updatePhoneNumber=function(e){return Y.updatePhoneNumber(this.user,e)},W.prototype.updateProfile=function(e){return Y.updateProfile(this.user,e)},W.prototype.verifyBeforeUpdateEmail=function(e,t){return Y.verifyBeforeUpdateEmail(this.user,e,t)},W.prototype.unwrap=function(){return this.user},Object.defineProperty(W.prototype,"emailVerified",{get:function(){return this.user.emailVerified},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"isAnonymous",{get:function(){return this.user.isAnonymous},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"metadata",{get:function(){return this.user.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"phoneNumber",{get:function(){return this.user.phoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"providerData",{get:function(){return this.user.providerData},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"refreshToken",{get:function(){return this.user.refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"tenantId",{get:function(){return this.user.tenantId},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"displayName",{get:function(){return this.user.displayName},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"email",{get:function(){return this.user.email},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"photoURL",{get:function(){return this.user.photoURL},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"providerId",{get:function(){return this.user.providerId},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"uid",{get:function(){return this.user.uid},enumerable:!1,configurable:!0}),Object.defineProperty(W.prototype,"auth",{get:function(){return this.user.auth},enumerable:!1,configurable:!0}),W.USER_MAP=new WeakMap,W);function W(e){this.user=e,this.multiFactor=Y.multiFactor(e)}var T="persistence",L=Y._assert,M=(Object.defineProperty(j.prototype,"currentUser",{get:function(){return this.auth.currentUser?C.getOrCreate(this.auth.currentUser):null},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"languageCode",{get:function(){return this.auth.languageCode},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"settings",{get:function(){return this.auth.settings},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"tenantId",{get:function(){return this.auth.tenantId},enumerable:!1,configurable:!0}),j.prototype.useDeviceLanguage=function(){this.auth.useDeviceLanguage()},j.prototype.signOut=function(){return this.auth.signOut()},j.prototype.useEmulator=function(e,t){this.auth.useEmulator(e,t)},j.prototype.applyActionCode=function(e){return Y.applyActionCode(this.auth,e)},j.prototype.checkActionCode=function(e){return Y.checkActionCode(this.auth,e)},j.prototype.confirmPasswordReset=function(e,t){return Y.confirmPasswordReset(this.auth,e,t)},j.prototype.createUserWithEmailAndPassword=function(t,r){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,S(this.auth,Y.createUserWithEmailAndPassword(this.auth,t,r))]})})},j.prototype.fetchProvidersForEmail=function(e){return this.fetchSignInMethodsForEmail(e)},j.prototype.fetchSignInMethodsForEmail=function(e){return Y.fetchSignInMethodsForEmail(this.auth,e)},j.prototype.isSignInWithEmailLink=function(e){return Y.isSignInWithEmailLink(this.auth,e)},j.prototype.getRedirectResult=function(){return u(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return L(O(),this.auth,"operation-not-supported-in-this-environment"),[4,Y.getRedirectResult(this.auth,Y.browserPopupRedirectResolver)];case 1:return(t=e.sent())?[2,S(this.auth,Promise.resolve(t))]:[2,{credential:null,user:null}]}})})},j.prototype.onAuthStateChanged=function(e,t,r){e=F(e,t,r),t=e.next,r=e.error,e=e.complete;return this.auth.onAuthStateChanged(t,r,e)},j.prototype.onIdTokenChanged=function(e,t,r){e=F(e,t,r),t=e.next,r=e.error,e=e.complete;return this.auth.onIdTokenChanged(t,r,e)},j.prototype.sendSignInLinkToEmail=function(e,t){return Y.sendSignInLinkToEmail(this.auth,e,t)},j.prototype.sendPasswordResetEmail=function(e,t){return Y.sendPasswordResetEmail(this.auth,e,t||void 0)},j.prototype.setPersistence=function(i){return u(this,void 0,void 0,function(){function t(e,t){var r,n;switch(r=e,n=i,Y._assert(Object.values(N).includes(n),r,"invalid-persistence-type"),a()?Y._assert(n!==N.SESSION,r,"unsupported-persistence-type"):o()?Y._assert(n===N.NONE,r,"unsupported-persistence-type"):w()?Y._assert(n===N.NONE||n===N.LOCAL&&c(),r,"unsupported-persistence-type"):Y._assert(n===N.NONE||A(),r,"unsupported-persistence-type"),t){case N.SESSION:return Y.browserSessionPersistence;case N.LOCAL:return c()?Y.indexedDBLocalPersistence:Y.browserLocalPersistence;case N.NONE:return Y.inMemoryPersistence;default:return Y._fail("argument-error",{appName:e.name})}}return s(this,function(e){return[2,this.auth.setPersistence(t(this.auth,i))]})})},j.prototype.signInAndRetrieveDataWithCredential=function(e){return this.signInWithCredential(e)},j.prototype.signInAnonymously=function(){return S(this.auth,Y.signInAnonymously(this.auth))},j.prototype.signInWithCredential=function(e){return S(this.auth,Y.signInWithCredential(this.auth,e))},j.prototype.signInWithCustomToken=function(e){return S(this.auth,Y.signInWithCustomToken(this.auth,e))},j.prototype.signInWithEmailAndPassword=function(e,t){return S(this.auth,Y.signInWithEmailAndPassword(this.auth,e,t))},j.prototype.signInWithEmailLink=function(e,t){return S(this.auth,Y.signInWithEmailLink(this.auth,e,t))},j.prototype.signInWithPhoneNumber=function(e,t){return _(this.auth,Y.signInWithPhoneNumber(this.auth,e,k(t)))},j.prototype.signInWithPopup=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return L(O(),this.auth,"operation-not-supported-in-this-environment"),[2,S(this.auth,Y.signInWithPopup(this.auth,t,Y.browserPopupRedirectResolver))]})})},j.prototype.signInWithRedirect=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return L(O(),this.auth,"operation-not-supported-in-this-environment"),this.savePersistenceForRedirect(),[2,Y.signInWithRedirect(this.auth,t,Y.browserPopupRedirectResolver)]})})},j.prototype.updateCurrentUser=function(e){return this.auth.updateCurrentUser(k(e))},j.prototype.verifyPasswordResetCode=function(e){return Y.verifyPasswordResetCode(this.auth,e)},j.prototype.unwrap=function(){return this.auth},j.prototype._delete=function(){return this.auth._delete()},j.prototype.savePersistenceForRedirect=function(){var e=D(),t=Y._persistenceKeyName(T,this.auth.config.apiKey,this.auth.name);null!=e&&e.sessionStorage&&e.sessionStorage.setItem(t,this.auth._getPersistence())},j.prototype.getPersistenceFromRedirect=function(){var e=D();if(null==e||!e.sessionStorage)return null;var t=Y._persistenceKeyName(T,this.auth.config.apiKey,this.auth.name);switch(e.sessionStorage.getItem(t)){case Y.inMemoryPersistence.type:return Y.inMemoryPersistence;case Y.indexedDBLocalPersistence.type:return Y.indexedDBLocalPersistence;case Y.browserSessionPersistence.type:return Y.browserSessionPersistence;case Y.browserLocalPersistence.type:return Y.browserLocalPersistence;default:return null}},j);function j(e,t){this.app=e,this.auth=t;var r=e.options.apiKey;this.auth._deleted||((t=(t=this.getPersistenceFromRedirect())?[t]:[]).push(Y.indexedDBLocalPersistence),t=t.map(Y._getInstance),L(r,"invalid-api-key",{appName:e.name}),this.auth._updateErrorMap(Y.debugErrorMap),this.auth._initializeWithPersistence(t,Y.browserPopupRedirectResolver))}function D(){return"undefined"!=typeof window?window:null}function F(e,t,r){var n=e;"function"!=typeof e&&(n=e.next,t=e.error,r=e.complete);var i=n;return{next:function(e){return i(e&&C.getOrCreate(e))},error:t,complete:r}}var x=(U.credential=function(e,t){return Y.PhoneAuthProvider.credential(e,t)},U.prototype.verifyPhoneNumber=function(e,t){return this.phoneProvider.verifyPhoneNumber(e,k(t))},U.prototype.unwrap=function(){return this.phoneProvider},U.PHONE_SIGN_IN_METHOD=Y.PhoneAuthProvider.PHONE_SIGN_IN_METHOD,U.PROVIDER_ID=Y.PhoneAuthProvider.PROVIDER_ID,U);function U(){this.providerId="phone",this.phoneProvider=new Y.PhoneAuthProvider(k(i.default.auth()))}var V=Y._assert,G=(B.prototype.clear=function(){this.verifier.clear()},B.prototype.render=function(){return this.verifier.render()},B.prototype.verify=function(){return this.verifier.verify()},B.prototype.unwrap=function(){return this.verifier},B);function B(e,t,r){var n;void 0===r&&(r=i.default.app()),V(null===(n=r.options)||void 0===n?void 0:n.apiKey,"invalid-api-key",{appName:r.name}),this.verifier=new Y.RecaptchaVerifier(e,t,k(r.auth())),this.type=this.verifier.type}var H;Y.registerAuth(o()?"Node":a()?"ReactNative":w()?"Worker":"Browser"),(H=i.default).INTERNAL.registerComponent(new g("auth",function(e){var t=e.getProvider("app").getImmediate(),e=e.getProvider("auth-exp").getImmediate();return new M(t,e)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"}},EmailAuthProvider:Y.EmailAuthProvider,FacebookAuthProvider:Y.FacebookAuthProvider,GithubAuthProvider:Y.GithubAuthProvider,GoogleAuthProvider:Y.GoogleAuthProvider,OAuthProvider:Y.OAuthProvider,PhoneAuthProvider:x,PhoneMultiFactorGenerator:Y.PhoneMultiFactorGenerator,RecaptchaVerifier:G,TwitterAuthProvider:Y.TwitterAuthProvider,Auth:{Persistence:N},AuthCredential:Y.AuthCredential}).setInstantiationMode("LAZY").setMultipleInstances(!1)),H.registerVersion("auth","0.0.900")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-auth.js - be sure to load firebase-app.js first.")}});//# sourceMappingURL=firebase-auth.js.map
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/auth/internal")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/auth/internal"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.exp)}(this,function($,Q){"use strict";try{!function(){function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=e($),n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function u(e,u,s,a){return new(s=s||Promise)(function(r,t){function n(e){try{o(a.next(e))}catch(e){t(e)}}function i(e){try{o(a.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?r(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(n,i)}o((a=a.apply(e,u||[])).next())})}function s(r,n){var i,o,u,s={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,o&&(u=2&t[0]?o.return:t[0]?o.throw||((u=o.return)&&u.call(o),0):o.next)&&!(u=u.call(o,t[1])).done)return u;switch(o=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(u=0<(u=s.trys).length&&u[u.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){s.label=t[1];break}if(6===t[0]&&s.label<u[1]){s.label=u[1],u=t;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(t);break}u[2]&&s.ops.pop(),s.trys.pop();continue}t=n.call(r,s)}catch(e){t=[6,e],o=0}finally{i=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function t(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function a(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}function c(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function h(){return"indexedDB"in self&&null!=indexedDB}var o,p="FirebaseError",l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(d,o=Error),d);function d(e,t,r){t=o.call(this,t)||this;return t.code=e,t.customData=r,t.name=p,Object.setPrototypeOf(t,d.prototype),Error.captureStackTrace&&Error.captureStackTrace(t,f.prototype.create),t}var f=(r.prototype.create=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n,i=t[0]||{},o=this.service+"/"+e,e=this.errors[e],e=e?(n=i,e.replace(y,function(e,t){var r=n[t];return null!=r?String(r):"<"+t+"?>"})):"Error",e=this.serviceName+": "+e+" ("+o+").";return new l(o,e,i)},r);function r(e,t,r){this.service=e,this.serviceName=t,this.errors=r}var y=/\{\$([^}]+)}/g,v=(g.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},g.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},g.prototype.setServiceProps=function(e){return this.serviceProps=e,this},g);function g(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY"}function m(){var e;return(null===(e=null===self||void 0===self?void 0:self.location)||void 0===e?void 0:e.protocol)||null}function b(e){return void 0===e&&(e=t()),!("file:"!==m()&&"ionic:"!==m()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function P(){return(0<=(e=t()).indexOf("MSIE ")||0<=e.indexOf("Trident/"))&&11===(null===document||void 0===document?void 0:document.documentMode);var e}function I(e){return void 0===e&&(e=t()),P()||(void 0===(e=e)&&(e=t()),/Edge\/\d+/.test(e))}function E(){try{var e=self.localStorage,t=Q._generateEventId();if(e)return e.setItem(t,"1"),e.removeItem(t),!I()||h()}catch(e){return A()&&h()}return!1}function A(){return"undefined"!=typeof global&&"WorkerGlobalScope"in global&&"importScripts"in global}function R(){return("http:"===m()||"https:"===m()||"object"==typeof(e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0)&&void 0!==e.id||b())&&!(c()||a())&&E()&&!A();var e}function w(){return b()&&"undefined"!=typeof document}var _={LOCAL:"local",NONE:"none",SESSION:"session"},O=Q._assert,S="persistence";function N(n){return u(this,void 0,void 0,function(){var t,r;return s(this,function(e){switch(e.label){case 0:return[4,n._initializationPromise];case 1:return e.sent(),t=C(),r=Q._persistenceKeyName(S,n.config.apiKey,n.name),null!=t&&t.sessionStorage&&t.sessionStorage.setItem(r,n._getPersistence()),[2]}})})}function C(){return"undefined"!=typeof window?window:null}var k=Q._assert,W=Q._getInstance(Q.browserPopupRedirectResolver),T=Q._getInstance(Q.cordovaPopupRedirectResolver),L=(j.prototype._initialize=function(r){return u(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return this.underlyingResolver?[2,this.underlyingResolver._initialize(r)]:[4,function(){return u(this,void 0,void 0,function(){return s(this,function(e){return w()?[2,new Promise(function(e){var t=setTimeout(function(){e(!1)},1e3);document.addEventListener("deviceready",function(){clearTimeout(t),e(!0)})})]:[2,!1]})})}()];case 1:return t=e.sent(),this.underlyingResolver=t?T:W,[2,this.assertedUnderlyingResolver._initialize(r)]}})})},j.prototype._openPopup=function(e,t,r,n){return this.assertedUnderlyingResolver._openPopup(e,t,r,n)},j.prototype._openRedirect=function(e,t,r,n){return this.assertedUnderlyingResolver._openRedirect(e,t,r,n)},j.prototype._isIframeWebStorageSupported=function(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)},j.prototype._originValidation=function(e){return this.assertedUnderlyingResolver._originValidation(e)},Object.defineProperty(j.prototype,"_shouldInitProactively",{get:function(){return w()||W._shouldInitProactively},enumerable:!1,configurable:!0}),Object.defineProperty(j.prototype,"assertedUnderlyingResolver",{get:function(){return k(this.underlyingResolver,"internal-error"),this.underlyingResolver},enumerable:!1,configurable:!0}),j);function j(){this.underlyingResolver=null,this._redirectPersistence=Q.browserSessionPersistence,this._completeRedirectFn=Q._getRedirectResult}function M(i,o){return u(this,void 0,void 0,function(){var t,r,n;return s(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,o];case 1:return t=e.sent(),[3,3];case 2:throw"auth/multi-factor-auth-required"===(r=e.sent()).code&&(r.resolver=Q.getMultiFactorResolver(i,r)),r;case 3:return[4,t];case 4:return n=e.sent(),r=n.operationType,n=n.user,[2,{operationType:r,credential:function(e){var t=e.providerId,r=e._tokenResponse;if(!r)return null;if("temporaryProof"in r&&"phoneNumber"in r)return Q.PhoneAuthProvider.credentialFromResult(e);if(!t||"password"===t)return null;switch(t){case"google.com":return Q.GoogleAuthProvider.credentialFromResult(e);case"facebook.com":return Q.FacebookAuthProvider.credentialFromResult(e);case"github.com":return Q.GithubAuthProvider.credentialFromResult(e);case"twitter.com":return Q.TwitterAuthProvider.credentialFromResult(e);default:var n=r.oauthIdToken,i=r.oauthAccessToken,o=r.oauthTokenSecret,u=r.pendingToken,s=r.nonce;return i||o||n||u?new Q.OAuthProvider(t).credential({idToken:n,accessToken:i,rawNonce:s}):null}}(t),additionalUserInfo:Q.getAdditionalUserInfo(t),user:U.getOrCreate(n)}]}})})}function D(r,n){return u(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return[4,n];case 1:return[2,{verificationId:(t=e.sent()).verificationId,confirm:function(e){return M(r,t.confirm(e))}}]}})})}function F(e){return e.unwrap()}var U=(x.getOrCreate=function(e){return x.USER_MAP.has(e)||x.USER_MAP.set(e,new x(e)),x.USER_MAP.get(e)},x.prototype.delete=function(){return this.user.delete()},x.prototype.reload=function(){return this.user.reload()},x.prototype.toJSON=function(){return this.user.toJSON()},x.prototype.getIdTokenResult=function(e){return this.user.getIdTokenResult(e)},x.prototype.getIdToken=function(e){return this.user.getIdToken(e)},x.prototype.linkAndRetrieveDataWithCredential=function(e){return this.linkWithCredential(e)},x.prototype.linkWithCredential=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,M(this.auth,Q.linkWithCredential(this.user,t))]})})},x.prototype.linkWithPhoneNumber=function(t,r){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,D(this.auth,Q.linkWithPhoneNumber(this.user,t,F(r)))]})})},x.prototype.linkWithPopup=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,M(this.auth,Q.linkWithPopup(this.user,t,L))]})})},x.prototype.linkWithRedirect=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,N(Q._castAuth(this.auth))];case 1:return e.sent(),[2,Q.linkWithRedirect(this.user,t,L)]}})})},x.prototype.reauthenticateAndRetrieveDataWithCredential=function(e){return this.reauthenticateWithCredential(e)},x.prototype.reauthenticateWithCredential=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,M(this.auth,Q.reauthenticateWithCredential(this.user,t))]})})},x.prototype.reauthenticateWithPhoneNumber=function(e,t){return D(this.auth,Q.reauthenticateWithPhoneNumber(this.user,e,F(t)))},x.prototype.reauthenticateWithPopup=function(e){return M(this.auth,Q.reauthenticateWithPopup(this.user,e,L))},x.prototype.reauthenticateWithRedirect=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,N(Q._castAuth(this.auth))];case 1:return e.sent(),[2,Q.reauthenticateWithRedirect(this.user,t,L)]}})})},x.prototype.sendEmailVerification=function(e){return Q.sendEmailVerification(this.user,e)},x.prototype.unlink=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return[4,Q.unlink(this.user,t)];case 1:return e.sent(),[2,this]}})})},x.prototype.updateEmail=function(e){return Q.updateEmail(this.user,e)},x.prototype.updatePassword=function(e){return Q.updatePassword(this.user,e)},x.prototype.updatePhoneNumber=function(e){return Q.updatePhoneNumber(this.user,e)},x.prototype.updateProfile=function(e){return Q.updateProfile(this.user,e)},x.prototype.verifyBeforeUpdateEmail=function(e,t){return Q.verifyBeforeUpdateEmail(this.user,e,t)},x.prototype.unwrap=function(){return this.user},Object.defineProperty(x.prototype,"emailVerified",{get:function(){return this.user.emailVerified},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"isAnonymous",{get:function(){return this.user.isAnonymous},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"metadata",{get:function(){return this.user.metadata},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"phoneNumber",{get:function(){return this.user.phoneNumber},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"providerData",{get:function(){return this.user.providerData},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"refreshToken",{get:function(){return this.user.refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"tenantId",{get:function(){return this.user.tenantId},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"displayName",{get:function(){return this.user.displayName},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"email",{get:function(){return this.user.email},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"photoURL",{get:function(){return this.user.photoURL},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"providerId",{get:function(){return this.user.providerId},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"uid",{get:function(){return this.user.uid},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"auth",{get:function(){return this.user.auth},enumerable:!1,configurable:!0}),x.USER_MAP=new WeakMap,x);function x(e){this.user=e,this.multiFactor=Q.multiFactor(e)}var V=Q._assert,G=(Object.defineProperty(B.prototype,"emulatorConfig",{get:function(){return this.auth.emulatorConfig},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"currentUser",{get:function(){return this.auth.currentUser?U.getOrCreate(this.auth.currentUser):null},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"languageCode",{get:function(){return this.auth.languageCode},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"settings",{get:function(){return this.auth.settings},enumerable:!1,configurable:!0}),Object.defineProperty(B.prototype,"tenantId",{get:function(){return this.auth.tenantId},enumerable:!1,configurable:!0}),B.prototype.useDeviceLanguage=function(){this.auth.useDeviceLanguage()},B.prototype.signOut=function(){return this.auth.signOut()},B.prototype.useEmulator=function(e,t){Q.useAuthEmulator(this.auth,e,t)},B.prototype.applyActionCode=function(e){return Q.applyActionCode(this.auth,e)},B.prototype.checkActionCode=function(e){return Q.checkActionCode(this.auth,e)},B.prototype.confirmPasswordReset=function(e,t){return Q.confirmPasswordReset(this.auth,e,t)},B.prototype.createUserWithEmailAndPassword=function(t,r){return u(this,void 0,void 0,function(){return s(this,function(e){return[2,M(this.auth,Q.createUserWithEmailAndPassword(this.auth,t,r))]})})},B.prototype.fetchProvidersForEmail=function(e){return this.fetchSignInMethodsForEmail(e)},B.prototype.fetchSignInMethodsForEmail=function(e){return Q.fetchSignInMethodsForEmail(this.auth,e)},B.prototype.isSignInWithEmailLink=function(e){return Q.isSignInWithEmailLink(this.auth,e)},B.prototype.getRedirectResult=function(){return u(this,void 0,void 0,function(){var t;return s(this,function(e){switch(e.label){case 0:return V(R(),this.auth,"operation-not-supported-in-this-environment"),[4,Q.getRedirectResult(this.auth,L)];case 1:return(t=e.sent())?[2,M(this.auth,Promise.resolve(t))]:[2,{credential:null,user:null}]}})})},B.prototype.onAuthStateChanged=function(e,t,r){e=H(e,t,r),t=e.next,r=e.error,e=e.complete;return this.auth.onAuthStateChanged(t,r,e)},B.prototype.onIdTokenChanged=function(e,t,r){e=H(e,t,r),t=e.next,r=e.error,e=e.complete;return this.auth.onIdTokenChanged(t,r,e)},B.prototype.sendSignInLinkToEmail=function(e,t){return Q.sendSignInLinkToEmail(this.auth,e,t)},B.prototype.sendPasswordResetEmail=function(e,t){return Q.sendPasswordResetEmail(this.auth,e,t||void 0)},B.prototype.setPersistence=function(o){return u(this,void 0,void 0,function(){var n,i;return s(this,function(e){switch(e.label){case 0:switch(t=this.auth,r=o,O(Object.values(_).includes(r),t,"invalid-persistence-type"),c()?O(r!==_.SESSION,t,"unsupported-persistence-type"):a()?O(r===_.NONE,t,"unsupported-persistence-type"):A()?O(r===_.NONE||r===_.LOCAL&&h(),t,"unsupported-persistence-type"):O(r===_.NONE||E(),t,"unsupported-persistence-type"),o){case _.SESSION:return[3,1];case _.LOCAL:return[3,2];case _.NONE:return[3,4]}return[3,5];case 1:return n=Q.browserSessionPersistence,[3,6];case 2:return[4,Q.indexedDBLocalPersistence._isAvailable()];case 3:return i=e.sent(),n=i?Q.indexedDBLocalPersistence:Q.browserLocalPersistence,[3,6];case 4:return n=Q.inMemoryPersistence,[3,6];case 5:return[2,Q._fail("argument-error",{appName:this.auth.name})];case 6:return[2,this.auth.setPersistence(n)]}var t,r})})},B.prototype.signInAndRetrieveDataWithCredential=function(e){return this.signInWithCredential(e)},B.prototype.signInAnonymously=function(){return M(this.auth,Q.signInAnonymously(this.auth))},B.prototype.signInWithCredential=function(e){return M(this.auth,Q.signInWithCredential(this.auth,e))},B.prototype.signInWithCustomToken=function(e){return M(this.auth,Q.signInWithCustomToken(this.auth,e))},B.prototype.signInWithEmailAndPassword=function(e,t){return M(this.auth,Q.signInWithEmailAndPassword(this.auth,e,t))},B.prototype.signInWithEmailLink=function(e,t){return M(this.auth,Q.signInWithEmailLink(this.auth,e,t))},B.prototype.signInWithPhoneNumber=function(e,t){return D(this.auth,Q.signInWithPhoneNumber(this.auth,e,F(t)))},B.prototype.signInWithPopup=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){return V(R(),this.auth,"operation-not-supported-in-this-environment"),[2,M(this.auth,Q.signInWithPopup(this.auth,t,L))]})})},B.prototype.signInWithRedirect=function(t){return u(this,void 0,void 0,function(){return s(this,function(e){switch(e.label){case 0:return V(R(),this.auth,"operation-not-supported-in-this-environment"),[4,N(this.auth)];case 1:return e.sent(),[2,Q.signInWithRedirect(this.auth,t,L)]}})})},B.prototype.updateCurrentUser=function(e){return this.auth.updateCurrentUser(F(e))},B.prototype.verifyPasswordResetCode=function(e){return Q.verifyPasswordResetCode(this.auth,e)},B.prototype.unwrap=function(){return this.auth},B.prototype._delete=function(){return this.auth._delete()},B);function B(e,t){this.app=e,this.auth=t;var r=e.options.apiKey;if(!this.auth._deleted){for(var n=function(e){var t=C();if(null==t||!t.sessionStorage)return[];switch(e=Q._persistenceKeyName(S,e.config.apiKey,e.name),t.sessionStorage.getItem(e)){case _.NONE:return[Q.inMemoryPersistence];case _.LOCAL:return[Q.indexedDBLocalPersistence,Q.browserSessionPersistence];case _.SESSION:return[Q.browserSessionPersistence];default:return[]}}(this.auth),i=0,o=[Q.indexedDBLocalPersistence,Q.browserLocalPersistence];i<o.length;i++){var u=o[i];n.includes(u)||n.push(u)}t=n.map(Q._getInstance);V(r,"invalid-api-key",{appName:e.name}),this.auth._updateErrorMap(Q.debugErrorMap);e="undefined"!=typeof window?L:void 0;this.auth._initializeWithPersistence(t,e)}}function H(e,t,r){var n=e;"function"!=typeof e&&(n=e.next,t=e.error,r=e.complete);var i=n;return{next:function(e){return i(e&&U.getOrCreate(e))},error:t,complete:r}}var K=(Y.credential=function(e,t){return Q.PhoneAuthProvider.credential(e,t)},Y.prototype.verifyPhoneNumber=function(e,t){return this.phoneProvider.verifyPhoneNumber(e,F(t))},Y.prototype.unwrap=function(){return this.phoneProvider},Y.PHONE_SIGN_IN_METHOD=Q.PhoneAuthProvider.PHONE_SIGN_IN_METHOD,Y.PROVIDER_ID=Q.PhoneAuthProvider.PROVIDER_ID,Y);function Y(){this.providerId="phone",this.phoneProvider=new Q.PhoneAuthProvider(F(i.default.auth()))}var z=Q._assert,q=(J.prototype.clear=function(){this.verifier.clear()},J.prototype.render=function(){return this.verifier.render()},J.prototype.verify=function(){return this.verifier.verify()},J.prototype.unwrap=function(){return this.verifier},J);function J(e,t,r){var n;void 0===r&&(r=i.default.app()),z(null===(n=r.options)||void 0===n?void 0:n.apiKey,"invalid-api-key",{appName:r.name}),this.verifier=new Q.RecaptchaVerifier(e,t,F(r.auth())),this.type=this.verifier.type}var Z;(Z=i.default).INTERNAL.registerComponent(new v("auth-compat",function(e){var t=e.getProvider("app-compat").getImmediate(),e=e.getProvider("auth-exp").getImmediate();return new G(t,e)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"}},EmailAuthProvider:Q.EmailAuthProvider,FacebookAuthProvider:Q.FacebookAuthProvider,GithubAuthProvider:Q.GithubAuthProvider,GoogleAuthProvider:Q.GoogleAuthProvider,OAuthProvider:Q.OAuthProvider,PhoneAuthProvider:K,PhoneMultiFactorGenerator:Q.PhoneMultiFactorGenerator,RecaptchaVerifier:q,TwitterAuthProvider:Q.TwitterAuthProvider,Auth:{Persistence:_},AuthCredential:Q.AuthCredential}).setInstantiationMode("LAZY").setMultipleInstances(!1)),Z.registerVersion("auth","0.0.900")}.apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-auth.js - be sure to load firebase-app.js first.")}});//# sourceMappingURL=firebase-auth.js.map
import firebase from '@firebase/app-compat';
import { _generateEventId, _assert as _assert$2, getAdditionalUserInfo, getMultiFactorResolver, PhoneAuthProvider as PhoneAuthProvider$1, OAuthProvider, TwitterAuthProvider, GithubAuthProvider, FacebookAuthProvider, GoogleAuthProvider, linkWithCredential, linkWithPhoneNumber, linkWithPopup, browserPopupRedirectResolver, linkWithRedirect, reauthenticateWithCredential, reauthenticateWithPhoneNumber, reauthenticateWithPopup, reauthenticateWithRedirect, sendEmailVerification, unlink, updateEmail, updatePassword, updatePhoneNumber, updateProfile, verifyBeforeUpdateEmail, multiFactor, applyActionCode, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, isSignInWithEmailLink, getRedirectResult, sendSignInLinkToEmail, sendPasswordResetEmail, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, verifyPasswordResetCode, _persistenceKeyName, browserLocalPersistence, browserSessionPersistence, indexedDBLocalPersistence, inMemoryPersistence, _getInstance, debugErrorMap, _fail, RecaptchaVerifier as RecaptchaVerifier$1, registerAuth, EmailAuthProvider, PhoneMultiFactorGenerator, AuthCredential } from '@firebase/auth/internal';
import '@firebase/auth-types';
import { _generateEventId, _persistenceKeyName, _assert as _assert$4, browserSessionPersistence, indexedDBLocalPersistence, inMemoryPersistence, _getInstance, browserPopupRedirectResolver, cordovaPopupRedirectResolver, _getRedirectResult, getAdditionalUserInfo, getMultiFactorResolver, PhoneAuthProvider as PhoneAuthProvider$1, OAuthProvider, TwitterAuthProvider, GithubAuthProvider, FacebookAuthProvider, GoogleAuthProvider, linkWithCredential, linkWithPhoneNumber, linkWithPopup, linkWithRedirect, _castAuth, reauthenticateWithCredential, reauthenticateWithPhoneNumber, reauthenticateWithPopup, reauthenticateWithRedirect, sendEmailVerification, unlink, updateEmail, updatePassword, updatePhoneNumber, updateProfile, verifyBeforeUpdateEmail, multiFactor, useAuthEmulator, applyActionCode, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, isSignInWithEmailLink, getRedirectResult, sendSignInLinkToEmail, sendPasswordResetEmail, _fail, browserLocalPersistence, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, verifyPasswordResetCode, debugErrorMap, RecaptchaVerifier as RecaptchaVerifier$1, EmailAuthProvider, PhoneMultiFactorGenerator, AuthCredential } from '@firebase/auth/internal';
import { Component } from '@firebase/component';
import { __awaiter, __generator } from 'tslib';
import '@firebase/app-types';
import { isBrowserExtension, isReactNative, isNode, getUA, isIE, isIndexedDBAvailable } from '@firebase/util';

@@ -27,2 +25,3 @@

*/
var CORDOVA_ONDEVICEREADY_TIMEOUT_MS = 1000;
function _getCurrentScheme() {

@@ -133,14 +132,25 @@ var _a;

}
function _getClientPlatform() {
if (isNode()) {
return "Node" /* NODE */;
}
if (isReactNative()) {
return "ReactNative" /* REACT_NATIVE */;
}
if (_isWorker()) {
return "Worker" /* WORKER */;
}
return "Browser" /* BROWSER */;
/** Quick check that indicates the platform *may* be Cordova */
function _isLikelyCordova() {
return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';
}
function _isCordova() {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
if (!_isLikelyCordova()) {
return [2 /*return*/, false];
}
return [2 /*return*/, new Promise(function (resolve) {
var timeoutId = setTimeout(function () {
// We've waited long enough; the telltale Cordova event didn't happen
resolve(false);
}, CORDOVA_ONDEVICEREADY_TIMEOUT_MS);
document.addEventListener('deviceready', function () {
clearTimeout(timeoutId);
resolve(true);
});
})];
});
});
}

@@ -164,6 +174,8 @@ /**

var Persistence = {
LOCAL: 'LOCAL',
NONE: 'NONE',
SESSION: 'SESSION'
LOCAL: 'local',
NONE: 'none',
SESSION: 'session'
};
var _assert = _assert$4;
var PERSISTENCE_KEY = 'persistence';
/**

@@ -174,7 +186,7 @@ * Validates that an argument is a valid persistence value. If an invalid type

function _validatePersistenceArgument(auth, persistence) {
_assert$2(Object.values(Persistence).includes(persistence), auth, "invalid-persistence-type" /* INVALID_PERSISTENCE */);
_assert(Object.values(Persistence).includes(persistence), auth, "invalid-persistence-type" /* INVALID_PERSISTENCE */);
// Validate if the specified type is supported in the current environment.
if (isReactNative()) {
// This is only supported in a browser.
_assert$2(persistence !== Persistence.SESSION, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence !== Persistence.SESSION, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;

@@ -184,3 +196,3 @@ }

// Only none is supported in Node.js.
_assert$2(persistence === Persistence.NONE, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence === Persistence.NONE, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;

@@ -191,3 +203,3 @@ }

// If indexedDB not supported and LOCAL provided, throw an error
_assert$2(persistence === Persistence.NONE ||
_assert(persistence === Persistence.NONE ||
(persistence === Persistence.LOCAL && isIndexedDBAvailable()), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);

@@ -197,4 +209,43 @@ return;

// This is restricted by what the browser supports.
_assert$2(persistence === Persistence.NONE || _isWebStorageSupported(), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence === Persistence.NONE || _isWebStorageSupported(), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
}
function _savePersistenceForRedirect(auth) {
return __awaiter(this, void 0, void 0, function () {
var win, key;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, auth._initializationPromise];
case 1:
_a.sent();
win = getSelfWindow();
key = _persistenceKeyName(PERSISTENCE_KEY, auth.config.apiKey, auth.name);
if (win === null || win === void 0 ? void 0 : win.sessionStorage) {
win.sessionStorage.setItem(key, auth._getPersistence());
}
return [2 /*return*/];
}
});
});
}
function _getPersistencesFromRedirect(auth) {
var win = getSelfWindow();
if (!(win === null || win === void 0 ? void 0 : win.sessionStorage)) {
return [];
}
var key = _persistenceKeyName(PERSISTENCE_KEY, auth.config.apiKey, auth.name);
var persistence = win.sessionStorage.getItem(key);
switch (persistence) {
case Persistence.NONE:
return [inMemoryPersistence];
case Persistence.LOCAL:
return [indexedDBLocalPersistence, browserSessionPersistence];
case Persistence.SESSION:
return [browserSessionPersistence];
default:
return [];
}
}
function getSelfWindow() {
return typeof window !== 'undefined' ? window : null;
}

@@ -217,2 +268,76 @@ /**

*/
var _assert$1 = _assert$4;
var BROWSER_RESOLVER = _getInstance(browserPopupRedirectResolver);
var CORDOVA_RESOLVER = _getInstance(cordovaPopupRedirectResolver);
/** Platform-agnostic popup-redirect resolver */
var CompatPopupRedirectResolver = /** @class */ (function () {
function CompatPopupRedirectResolver() {
this.underlyingResolver = null;
this._redirectPersistence = browserSessionPersistence;
this._completeRedirectFn = _getRedirectResult;
}
CompatPopupRedirectResolver.prototype._initialize = function (auth) {
return __awaiter(this, void 0, void 0, function () {
var isCordova;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (this.underlyingResolver) {
return [2 /*return*/, this.underlyingResolver._initialize(auth)];
}
return [4 /*yield*/, _isCordova()];
case 1:
isCordova = _a.sent();
this.underlyingResolver = isCordova ? CORDOVA_RESOLVER : BROWSER_RESOLVER;
return [2 /*return*/, this.assertedUnderlyingResolver._initialize(auth)];
}
});
});
};
CompatPopupRedirectResolver.prototype._openPopup = function (auth, provider, authType, eventId) {
return this.assertedUnderlyingResolver._openPopup(auth, provider, authType, eventId);
};
CompatPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
return this.assertedUnderlyingResolver._openRedirect(auth, provider, authType, eventId);
};
CompatPopupRedirectResolver.prototype._isIframeWebStorageSupported = function (auth, cb) {
this.assertedUnderlyingResolver._isIframeWebStorageSupported(auth, cb);
};
CompatPopupRedirectResolver.prototype._originValidation = function (auth) {
return this.assertedUnderlyingResolver._originValidation(auth);
};
Object.defineProperty(CompatPopupRedirectResolver.prototype, "_shouldInitProactively", {
get: function () {
return _isLikelyCordova() || BROWSER_RESOLVER._shouldInitProactively;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CompatPopupRedirectResolver.prototype, "assertedUnderlyingResolver", {
get: function () {
_assert$1(this.underlyingResolver, "internal-error" /* INTERNAL_ERROR */);
return this.underlyingResolver;
},
enumerable: false,
configurable: true
});
return CompatPopupRedirectResolver;
}());
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function credentialFromResponse(userCredential) {

@@ -404,3 +529,3 @@ var providerId = userCredential.providerId, _tokenResponse = userCredential._tokenResponse;

return __generator(this, function (_a) {
return [2 /*return*/, convertCredential(this.auth, linkWithPopup(this.user, provider, browserPopupRedirectResolver))];
return [2 /*return*/, convertCredential(this.auth, linkWithPopup(this.user, provider, CompatPopupRedirectResolver))];
});

@@ -410,3 +535,12 @@ });

User.prototype.linkWithRedirect = function (provider) {
return linkWithRedirect(this.user, provider, browserPopupRedirectResolver);
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, _savePersistenceForRedirect(_castAuth(this.auth))];
case 1:
_a.sent();
return [2 /*return*/, linkWithRedirect(this.user, provider, CompatPopupRedirectResolver)];
}
});
});
};

@@ -427,6 +561,15 @@ User.prototype.reauthenticateAndRetrieveDataWithCredential = function (credential) {

User.prototype.reauthenticateWithPopup = function (provider) {
return convertCredential(this.auth, reauthenticateWithPopup(this.user, provider, browserPopupRedirectResolver));
return convertCredential(this.auth, reauthenticateWithPopup(this.user, provider, CompatPopupRedirectResolver));
};
User.prototype.reauthenticateWithRedirect = function (provider) {
return reauthenticateWithRedirect(this.user, provider, browserPopupRedirectResolver);
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, _savePersistenceForRedirect(_castAuth(this.auth))];
case 1:
_a.sent();
return [2 /*return*/, reauthenticateWithRedirect(this.user, provider, CompatPopupRedirectResolver)];
}
});
});
};

@@ -579,4 +722,3 @@ User.prototype.sendEmailVerification = function (actionCodeSettings) {

*/
var PERSISTENCE_KEY = 'persistence';
var _assert = _assert$2;
var _assert$2 = _assert$4;
var Auth = /** @class */ (function () {

@@ -593,18 +735,33 @@ // private readonly auth: impl.AuthImpl;

// persistence is checked *first* rather than last. This is because we want
// the fallback (if no user is found) to be the stored persistence type
var storedPersistence = this.getPersistenceFromRedirect();
var persistences = storedPersistence ? [storedPersistence] : [];
persistences.push(indexedDBLocalPersistence);
// TODO(avolkovi): Implement proper persistence fallback
// to prefer stored persistence type in the hierarchy.
var persistences = _getPersistencesFromRedirect(this.auth);
for (var _i = 0, _a = [
indexedDBLocalPersistence,
browserLocalPersistence
]; _i < _a.length; _i++) {
var persistence = _a[_i];
if (!persistences.includes(persistence)) {
persistences.push(persistence);
}
}
var hierarchy = persistences.map(_getInstance);
// TODO: platform needs to be determined using heuristics
_assert(apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
_assert$2(apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name
});
this.auth._updateErrorMap(debugErrorMap);
// Only use a popup/redirect resolver in browser environments
var resolver = typeof window !== 'undefined' ? CompatPopupRedirectResolver : undefined;
// This promise is intended to float; auth initialization happens in the
// background, meanwhile the auth object may be used by the app.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.auth._initializeWithPersistence(hierarchy, browserPopupRedirectResolver);
this.auth._initializeWithPersistence(hierarchy, resolver);
}
Object.defineProperty(Auth.prototype, "emulatorConfig", {
get: function () {
return this.auth.emulatorConfig;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Auth.prototype, "currentUser", {

@@ -648,3 +805,3 @@ get: function () {

Auth.prototype.useEmulator = function (url, options) {
this.auth.useEmulator(url, options);
useAuthEmulator(this.auth, url, options);
};

@@ -682,4 +839,4 @@ Auth.prototype.applyActionCode = function (code) {

case 0:
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [4 /*yield*/, getRedirectResult(this.auth, browserPopupRedirectResolver)];
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [4 /*yield*/, getRedirectResult(this.auth, CompatPopupRedirectResolver)];
case 1:

@@ -714,21 +871,32 @@ credential = _a.sent();

return __awaiter(this, void 0, void 0, function () {
function convertPersistence(auth, persistenceCompat) {
_validatePersistenceArgument(auth, persistence);
switch (persistenceCompat) {
case Persistence.SESSION:
return browserSessionPersistence;
case Persistence.LOCAL:
return isIndexedDBAvailable()
var converted, _a, isIndexedDBFullySupported;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_validatePersistenceArgument(this.auth, persistence);
_a = persistence;
switch (_a) {
case Persistence.SESSION: return [3 /*break*/, 1];
case Persistence.LOCAL: return [3 /*break*/, 2];
case Persistence.NONE: return [3 /*break*/, 4];
}
return [3 /*break*/, 5];
case 1:
converted = browserSessionPersistence;
return [3 /*break*/, 6];
case 2: return [4 /*yield*/, indexedDBLocalPersistence._isAvailable()];
case 3:
isIndexedDBFullySupported = _b.sent();
converted = isIndexedDBFullySupported
? indexedDBLocalPersistence
: browserLocalPersistence;
case Persistence.NONE:
return inMemoryPersistence;
default:
return _fail("argument-error" /* ARGUMENT_ERROR */, {
appName: auth.name
});
return [3 /*break*/, 6];
case 4:
converted = inMemoryPersistence;
return [3 /*break*/, 6];
case 5: return [2 /*return*/, _fail("argument-error" /* ARGUMENT_ERROR */, {
appName: this.auth.name
})];
case 6: return [2 /*return*/, this.auth.setPersistence(converted)];
}
}
return __generator(this, function (_a) {
return [2 /*return*/, this.auth.setPersistence(convertPersistence(this.auth, persistence))];
});

@@ -761,4 +929,4 @@ });

return __generator(this, function (_a) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [2 /*return*/, convertCredential(this.auth, signInWithPopup(this.auth, provider, browserPopupRedirectResolver))];
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [2 /*return*/, convertCredential(this.auth, signInWithPopup(this.auth, provider, CompatPopupRedirectResolver))];
});

@@ -770,5 +938,10 @@ });

return __generator(this, function (_a) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
this.savePersistenceForRedirect();
return [2 /*return*/, signInWithRedirect(this.auth, provider, browserPopupRedirectResolver)];
switch (_a.label) {
case 0:
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [4 /*yield*/, _savePersistenceForRedirect(this.auth)];
case 1:
_a.sent();
return [2 /*return*/, signInWithRedirect(this.auth, provider, CompatPopupRedirectResolver)];
}
});

@@ -789,34 +962,4 @@ });

};
Auth.prototype.savePersistenceForRedirect = function () {
var win = getSelfWindow();
var key = _persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
if (win === null || win === void 0 ? void 0 : win.sessionStorage) {
win.sessionStorage.setItem(key, this.auth._getPersistence());
}
};
Auth.prototype.getPersistenceFromRedirect = function () {
var win = getSelfWindow();
if (!(win === null || win === void 0 ? void 0 : win.sessionStorage)) {
return null;
}
var key = _persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
var persistence = win.sessionStorage.getItem(key);
switch (persistence) {
case inMemoryPersistence.type:
return inMemoryPersistence;
case indexedDBLocalPersistence.type:
return indexedDBLocalPersistence;
case browserSessionPersistence.type:
return browserSessionPersistence;
case browserLocalPersistence.type:
return browserLocalPersistence;
default:
return null;
}
};
return Auth;
}());
function getSelfWindow() {
return typeof window !== 'undefined' ? window : null;
}
function wrapObservers(nextOrObserver, error, complete) {

@@ -858,2 +1001,4 @@ var next = nextOrObserver;

this.providerId = 'phone';
// TODO: remove ts-ignore when moving types from auth-types to auth-compat
// @ts-ignore
this.phoneProvider = new PhoneAuthProvider$1(unwrap(firebase.auth()));

@@ -894,3 +1039,3 @@ }

*/
var _assert$1 = _assert$2;
var _assert$3 = _assert$4;
var RecaptchaVerifier = /** @class */ (function () {

@@ -901,3 +1046,3 @@ function RecaptchaVerifier(container, parameters, app) {

// API key is required for web client RPC calls.
_assert$1((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
_assert$3((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name

@@ -907,3 +1052,6 @@ });

// eslint-disable-next-line @typescript-eslint/no-explicit-any
parameters, unwrap(app.auth()));
parameters,
// TODO: remove ts-ignore when moving types from auth-types to auth-compat
// @ts-ignore
unwrap(app.auth()));
this.type = this.verifier.type;

@@ -942,3 +1090,3 @@ }

*/
var AUTH_TYPE = 'auth';
var AUTH_TYPE = 'auth-compat';
// Create auth components to register with firebase.

@@ -949,3 +1097,3 @@ // Provides Auth public APIs.

// getImmediate for FirebaseApp will always succeed
var app = container.getProvider('app').getImmediate();
var app = container.getProvider('app-compat').getImmediate();
var auth = container.getProvider('auth-exp').getImmediate();

@@ -985,4 +1133,3 @@ return new Auth(app, auth);

}
registerAuth(_getClientPlatform());
registerAuthCompat(firebase);
//# sourceMappingURL=index.esm.js.map
import firebase from '@firebase/app-compat';
import { _generateEventId, _assert as _assert$2, getAdditionalUserInfo, PhoneAuthProvider as PhoneAuthProvider$1, OAuthProvider, TwitterAuthProvider, GithubAuthProvider, FacebookAuthProvider, GoogleAuthProvider, getMultiFactorResolver, multiFactor, linkWithCredential, linkWithPhoneNumber, linkWithPopup, browserPopupRedirectResolver, linkWithRedirect, reauthenticateWithCredential, reauthenticateWithPhoneNumber, reauthenticateWithPopup, reauthenticateWithRedirect, sendEmailVerification, unlink, updateEmail, updatePassword, updatePhoneNumber, updateProfile, verifyBeforeUpdateEmail, _getInstance, debugErrorMap, applyActionCode, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, isSignInWithEmailLink, getRedirectResult, sendSignInLinkToEmail, sendPasswordResetEmail, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, verifyPasswordResetCode, _persistenceKeyName, browserLocalPersistence, browserSessionPersistence, indexedDBLocalPersistence, inMemoryPersistence, _fail, RecaptchaVerifier as RecaptchaVerifier$1, registerAuth, EmailAuthProvider, PhoneMultiFactorGenerator, AuthCredential } from '@firebase/auth/internal';
import '@firebase/auth-types';
import { _generateEventId, _persistenceKeyName, browserSessionPersistence, indexedDBLocalPersistence, inMemoryPersistence, _assert as _assert$4, _getInstance, browserPopupRedirectResolver, cordovaPopupRedirectResolver, _getRedirectResult, getAdditionalUserInfo, PhoneAuthProvider as PhoneAuthProvider$1, OAuthProvider, TwitterAuthProvider, GithubAuthProvider, FacebookAuthProvider, GoogleAuthProvider, getMultiFactorResolver, multiFactor, linkWithCredential, linkWithPhoneNumber, linkWithPopup, _castAuth, linkWithRedirect, reauthenticateWithCredential, reauthenticateWithPhoneNumber, reauthenticateWithPopup, reauthenticateWithRedirect, sendEmailVerification, unlink, updateEmail, updatePassword, updatePhoneNumber, updateProfile, verifyBeforeUpdateEmail, browserLocalPersistence, debugErrorMap, useAuthEmulator, applyActionCode, checkActionCode, confirmPasswordReset, createUserWithEmailAndPassword, fetchSignInMethodsForEmail, isSignInWithEmailLink, getRedirectResult, sendSignInLinkToEmail, sendPasswordResetEmail, _fail, signInAnonymously, signInWithCredential, signInWithCustomToken, signInWithEmailAndPassword, signInWithEmailLink, signInWithPhoneNumber, signInWithPopup, signInWithRedirect, verifyPasswordResetCode, RecaptchaVerifier as RecaptchaVerifier$1, EmailAuthProvider, PhoneMultiFactorGenerator, AuthCredential } from '@firebase/auth/internal';
import { Component } from '@firebase/component';
import '@firebase/app-types';
import { isNode, isReactNative, isBrowserExtension, getUA, isIE, isIndexedDBAvailable } from '@firebase/util';
import { isBrowserExtension, isReactNative, isNode, getUA, isIE, isIndexedDBAvailable } from '@firebase/util';

@@ -26,2 +24,3 @@ var version = "0.0.900";

*/
const CORDOVA_ONDEVICEREADY_TIMEOUT_MS = 1000;
function _getCurrentScheme() {

@@ -129,13 +128,20 @@ var _a;

}
function _getClientPlatform() {
if (isNode()) {
return "Node" /* NODE */;
/** Quick check that indicates the platform *may* be Cordova */
function _isLikelyCordova() {
return _isAndroidOrIosCordovaScheme() && typeof document !== 'undefined';
}
async function _isCordova() {
if (!_isLikelyCordova()) {
return false;
}
if (isReactNative()) {
return "ReactNative" /* REACT_NATIVE */;
}
if (_isWorker()) {
return "Worker" /* WORKER */;
}
return "Browser" /* BROWSER */;
return new Promise(resolve => {
const timeoutId = setTimeout(() => {
// We've waited long enough; the telltale Cordova event didn't happen
resolve(false);
}, CORDOVA_ONDEVICEREADY_TIMEOUT_MS);
document.addEventListener('deviceready', () => {
clearTimeout(timeoutId);
resolve(true);
});
});
}

@@ -160,6 +166,8 @@

const Persistence = {
LOCAL: 'LOCAL',
NONE: 'NONE',
SESSION: 'SESSION'
LOCAL: 'local',
NONE: 'none',
SESSION: 'session'
};
const _assert = _assert$4;
const PERSISTENCE_KEY = 'persistence';
/**

@@ -170,7 +178,7 @@ * Validates that an argument is a valid persistence value. If an invalid type

function _validatePersistenceArgument(auth, persistence) {
_assert$2(Object.values(Persistence).includes(persistence), auth, "invalid-persistence-type" /* INVALID_PERSISTENCE */);
_assert(Object.values(Persistence).includes(persistence), auth, "invalid-persistence-type" /* INVALID_PERSISTENCE */);
// Validate if the specified type is supported in the current environment.
if (isReactNative()) {
// This is only supported in a browser.
_assert$2(persistence !== Persistence.SESSION, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence !== Persistence.SESSION, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;

@@ -180,3 +188,3 @@ }

// Only none is supported in Node.js.
_assert$2(persistence === Persistence.NONE, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence === Persistence.NONE, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;

@@ -187,3 +195,3 @@ }

// If indexedDB not supported and LOCAL provided, throw an error
_assert$2(persistence === Persistence.NONE ||
_assert(persistence === Persistence.NONE ||
(persistence === Persistence.LOCAL && isIndexedDBAvailable()), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);

@@ -193,4 +201,33 @@ return;

// This is restricted by what the browser supports.
_assert$2(persistence === Persistence.NONE || _isWebStorageSupported(), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
_assert(persistence === Persistence.NONE || _isWebStorageSupported(), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
}
async function _savePersistenceForRedirect(auth) {
await auth._initializationPromise;
const win = getSelfWindow();
const key = _persistenceKeyName(PERSISTENCE_KEY, auth.config.apiKey, auth.name);
if (win === null || win === void 0 ? void 0 : win.sessionStorage) {
win.sessionStorage.setItem(key, auth._getPersistence());
}
}
function _getPersistencesFromRedirect(auth) {
const win = getSelfWindow();
if (!(win === null || win === void 0 ? void 0 : win.sessionStorage)) {
return [];
}
const key = _persistenceKeyName(PERSISTENCE_KEY, auth.config.apiKey, auth.name);
const persistence = win.sessionStorage.getItem(key);
switch (persistence) {
case Persistence.NONE:
return [inMemoryPersistence];
case Persistence.LOCAL:
return [indexedDBLocalPersistence, browserSessionPersistence];
case Persistence.SESSION:
return [browserSessionPersistence];
default:
return [];
}
}
function getSelfWindow() {
return typeof window !== 'undefined' ? window : null;
}

@@ -213,2 +250,59 @@ /**

*/
const _assert$1 = _assert$4;
const BROWSER_RESOLVER = _getInstance(browserPopupRedirectResolver);
const CORDOVA_RESOLVER = _getInstance(cordovaPopupRedirectResolver);
/** Platform-agnostic popup-redirect resolver */
class CompatPopupRedirectResolver {
constructor() {
this.underlyingResolver = null;
this._redirectPersistence = browserSessionPersistence;
this._completeRedirectFn = _getRedirectResult;
}
async _initialize(auth) {
if (this.underlyingResolver) {
return this.underlyingResolver._initialize(auth);
}
// We haven't yet determined whether or not we're in Cordova; go ahead
// and determine that state now.
const isCordova = await _isCordova();
this.underlyingResolver = isCordova ? CORDOVA_RESOLVER : BROWSER_RESOLVER;
return this.assertedUnderlyingResolver._initialize(auth);
}
_openPopup(auth, provider, authType, eventId) {
return this.assertedUnderlyingResolver._openPopup(auth, provider, authType, eventId);
}
_openRedirect(auth, provider, authType, eventId) {
return this.assertedUnderlyingResolver._openRedirect(auth, provider, authType, eventId);
}
_isIframeWebStorageSupported(auth, cb) {
this.assertedUnderlyingResolver._isIframeWebStorageSupported(auth, cb);
}
_originValidation(auth) {
return this.assertedUnderlyingResolver._originValidation(auth);
}
get _shouldInitProactively() {
return _isLikelyCordova() || BROWSER_RESOLVER._shouldInitProactively;
}
get assertedUnderlyingResolver() {
_assert$1(this.underlyingResolver, "internal-error" /* INTERNAL_ERROR */);
return this.underlyingResolver;
}
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function credentialFromResponse(userCredential) {

@@ -368,6 +462,7 @@ const { providerId, _tokenResponse } = userCredential;

async linkWithPopup(provider) {
return convertCredential(this.auth, linkWithPopup(this.user, provider, browserPopupRedirectResolver));
return convertCredential(this.auth, linkWithPopup(this.user, provider, CompatPopupRedirectResolver));
}
linkWithRedirect(provider) {
return linkWithRedirect(this.user, provider, browserPopupRedirectResolver);
async linkWithRedirect(provider) {
await _savePersistenceForRedirect(_castAuth(this.auth));
return linkWithRedirect(this.user, provider, CompatPopupRedirectResolver);
}

@@ -384,6 +479,7 @@ reauthenticateAndRetrieveDataWithCredential(credential) {

reauthenticateWithPopup(provider) {
return convertCredential(this.auth, reauthenticateWithPopup(this.user, provider, browserPopupRedirectResolver));
return convertCredential(this.auth, reauthenticateWithPopup(this.user, provider, CompatPopupRedirectResolver));
}
reauthenticateWithRedirect(provider) {
return reauthenticateWithRedirect(this.user, provider, browserPopupRedirectResolver);
async reauthenticateWithRedirect(provider) {
await _savePersistenceForRedirect(_castAuth(this.auth));
return reauthenticateWithRedirect(this.user, provider, CompatPopupRedirectResolver);
}

@@ -475,4 +571,3 @@ sendEmailVerification(actionCodeSettings) {

*/
const PERSISTENCE_KEY = 'persistence';
const _assert = _assert$2;
const _assert$2 = _assert$4;
class Auth {

@@ -489,18 +584,28 @@ // private readonly auth: impl.AuthImpl;

// persistence is checked *first* rather than last. This is because we want
// the fallback (if no user is found) to be the stored persistence type
const storedPersistence = this.getPersistenceFromRedirect();
const persistences = storedPersistence ? [storedPersistence] : [];
persistences.push(indexedDBLocalPersistence);
// TODO(avolkovi): Implement proper persistence fallback
// to prefer stored persistence type in the hierarchy.
const persistences = _getPersistencesFromRedirect(this.auth);
for (const persistence of [
indexedDBLocalPersistence,
browserLocalPersistence
]) {
if (!persistences.includes(persistence)) {
persistences.push(persistence);
}
}
const hierarchy = persistences.map(_getInstance);
// TODO: platform needs to be determined using heuristics
_assert(apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
_assert$2(apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name
});
this.auth._updateErrorMap(debugErrorMap);
// Only use a popup/redirect resolver in browser environments
const resolver = typeof window !== 'undefined' ? CompatPopupRedirectResolver : undefined;
// This promise is intended to float; auth initialization happens in the
// background, meanwhile the auth object may be used by the app.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.auth._initializeWithPersistence(hierarchy, browserPopupRedirectResolver);
this.auth._initializeWithPersistence(hierarchy, resolver);
}
get emulatorConfig() {
return this.auth.emulatorConfig;
}
get currentUser() {

@@ -528,3 +633,3 @@ if (!this.auth.currentUser) {

useEmulator(url, options) {
this.auth.useEmulator(url, options);
useAuthEmulator(this.auth, url, options);
}

@@ -553,4 +658,4 @@ applyActionCode(code) {

async getRedirectResult() {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
const credential = await getRedirectResult(this.auth, browserPopupRedirectResolver);
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
const credential = await getRedirectResult(this.auth, CompatPopupRedirectResolver);
if (!credential) {

@@ -579,20 +684,24 @@ return {

async setPersistence(persistence) {
function convertPersistence(auth, persistenceCompat) {
_validatePersistenceArgument(auth, persistence);
switch (persistenceCompat) {
case Persistence.SESSION:
return browserSessionPersistence;
case Persistence.LOCAL:
return isIndexedDBAvailable()
? indexedDBLocalPersistence
: browserLocalPersistence;
case Persistence.NONE:
return inMemoryPersistence;
default:
return _fail("argument-error" /* ARGUMENT_ERROR */, {
appName: auth.name
});
}
_validatePersistenceArgument(this.auth, persistence);
let converted;
switch (persistence) {
case Persistence.SESSION:
converted = browserSessionPersistence;
break;
case Persistence.LOCAL:
// Not using isIndexedDBAvailable() since it only checks if indexedDB is defined.
const isIndexedDBFullySupported = await indexedDBLocalPersistence._isAvailable();
converted = isIndexedDBFullySupported
? indexedDBLocalPersistence
: browserLocalPersistence;
break;
case Persistence.NONE:
converted = inMemoryPersistence;
break;
default:
return _fail("argument-error" /* ARGUMENT_ERROR */, {
appName: this.auth.name
});
}
return this.auth.setPersistence(convertPersistence(this.auth, persistence));
return this.auth.setPersistence(converted);
}

@@ -621,9 +730,9 @@ signInAndRetrieveDataWithCredential(credential) {

async signInWithPopup(provider) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return convertCredential(this.auth, signInWithPopup(this.auth, provider, browserPopupRedirectResolver));
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return convertCredential(this.auth, signInWithPopup(this.auth, provider, CompatPopupRedirectResolver));
}
async signInWithRedirect(provider) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
this.savePersistenceForRedirect();
return signInWithRedirect(this.auth, provider, browserPopupRedirectResolver);
_assert$2(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
await _savePersistenceForRedirect(this.auth);
return signInWithRedirect(this.auth, provider, CompatPopupRedirectResolver);
}

@@ -642,33 +751,3 @@ updateCurrentUser(user) {

}
savePersistenceForRedirect() {
const win = getSelfWindow();
const key = _persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
if (win === null || win === void 0 ? void 0 : win.sessionStorage) {
win.sessionStorage.setItem(key, this.auth._getPersistence());
}
}
getPersistenceFromRedirect() {
const win = getSelfWindow();
if (!(win === null || win === void 0 ? void 0 : win.sessionStorage)) {
return null;
}
const key = _persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
const persistence = win.sessionStorage.getItem(key);
switch (persistence) {
case inMemoryPersistence.type:
return inMemoryPersistence;
case indexedDBLocalPersistence.type:
return indexedDBLocalPersistence;
case browserSessionPersistence.type:
return browserSessionPersistence;
case browserLocalPersistence.type:
return browserLocalPersistence;
default:
return null;
}
}
}
function getSelfWindow() {
return typeof window !== 'undefined' ? window : null;
}
function wrapObservers(nextOrObserver, error, complete) {

@@ -708,2 +787,4 @@ let next = nextOrObserver;

this.providerId = 'phone';
// TODO: remove ts-ignore when moving types from auth-types to auth-compat
// @ts-ignore
this.phoneProvider = new PhoneAuthProvider$1(unwrap(firebase.auth()));

@@ -743,3 +824,3 @@ }

*/
const _assert$1 = _assert$2;
const _assert$3 = _assert$4;
class RecaptchaVerifier {

@@ -749,3 +830,3 @@ constructor(container, parameters, app = firebase.app()) {

// API key is required for web client RPC calls.
_assert$1((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
_assert$3((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name

@@ -755,3 +836,6 @@ });

// eslint-disable-next-line @typescript-eslint/no-explicit-any
parameters, unwrap(app.auth()));
parameters,
// TODO: remove ts-ignore when moving types from auth-types to auth-compat
// @ts-ignore
unwrap(app.auth()));
this.type = this.verifier.type;

@@ -789,3 +873,3 @@ }

*/
const AUTH_TYPE = 'auth';
const AUTH_TYPE = 'auth-compat';
// Create auth components to register with firebase.

@@ -796,3 +880,3 @@ // Provides Auth public APIs.

// getImmediate for FirebaseApp will always succeed
const app = container.getProvider('app').getImmediate();
const app = container.getProvider('app-compat').getImmediate();
const auth = container.getProvider('auth-exp').getImmediate();

@@ -818,5 +902,5 @@ return new Auth(app, auth);

// SAMLAuthProvider,
PhoneAuthProvider,
PhoneAuthProvider: PhoneAuthProvider,
PhoneMultiFactorGenerator: PhoneMultiFactorGenerator,
RecaptchaVerifier,
RecaptchaVerifier: RecaptchaVerifier,
TwitterAuthProvider: TwitterAuthProvider,

@@ -833,4 +917,3 @@ Auth: {

}
registerAuth(_getClientPlatform());
registerAuthCompat(firebase);
//# sourceMappingURL=index.esm2017.js.map
'use strict';
var firebase = require('@firebase/app-compat');
var impl = require('@firebase/auth/internal');
require('@firebase/auth-types');
var component = require('@firebase/component');
var tslib = require('tslib');
require('@firebase/app-types');
var util = require('@firebase/util');
var exp = require('@firebase/auth/internal');
var fetchImpl = require('node-fetch');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
var fetchImpl__default = /*#__PURE__*/_interopDefaultLegacy(fetchImpl);
var version = "0.0.900";
/**
* @license
* Copyright 2020 Google LLC
* Copyright 2017 Google LLC
*

@@ -33,937 +26,3 @@ * Licensed under the Apache License, Version 2.0 (the "License");

*/
function _getCurrentScheme() {
var _a;
return ((_a = self === null || self === void 0 ? void 0 : self.location) === null || _a === void 0 ? void 0 : _a.protocol) || null;
}
/**
* @return {boolean} Whether the current environment is http or https.
*/
function _isHttpOrHttps() {
return _getCurrentScheme() === 'http:' || _getCurrentScheme() === 'https:';
}
/**
* @param {?string=} ua The user agent.
* @return {boolean} Whether the app is rendered in a mobile iOS or Android
* Cordova environment.
*/
function _isAndroidOrIosCordovaScheme(ua) {
if (ua === void 0) { ua = util.getUA(); }
return !!((_getCurrentScheme() === 'file:' || _getCurrentScheme() === 'ionic:') &&
ua.toLowerCase().match(/iphone|ipad|ipod|android/));
}
/**
* @return {boolean} Whether the environment is a native environment, where
* CORS checks do not apply.
*/
function _isNativeEnvironment() {
return util.isReactNative() || util.isNode();
}
/**
* Checks whether the user agent is IE11.
* @return {boolean} True if it is IE11.
*/
function _isIe11() {
return util.isIE() && (document === null || document === void 0 ? void 0 : document.documentMode) === 11;
}
/**
* Checks whether the user agent is Edge.
* @param {string} userAgent The browser user agent string.
* @return {boolean} True if it is Edge.
*/
function _isEdge(ua) {
if (ua === void 0) { ua = util.getUA(); }
return /Edge\/\d+/.test(ua);
}
/**
* @param {?string=} opt_userAgent The navigator user agent.
* @return {boolean} Whether local storage is not synchronized between an iframe
* and a popup of the same domain.
*/
function _isLocalStorageNotSynchronized(ua) {
if (ua === void 0) { ua = util.getUA(); }
return _isIe11() || _isEdge(ua);
}
/** @return {boolean} Whether web storage is supported. */
function _isWebStorageSupported() {
try {
var storage = self.localStorage;
var key = impl._generateEventId();
if (storage) {
// setItem will throw an exception if we cannot access WebStorage (e.g.,
// Safari in private mode).
storage['setItem'](key, '1');
storage['removeItem'](key);
// For browsers where iframe web storage does not synchronize with a popup
// of the same domain, indexedDB is used for persistent storage. These
// browsers include IE11 and Edge.
// Make sure it is supported (IE11 and Edge private mode does not support
// that).
if (_isLocalStorageNotSynchronized()) {
// In such browsers, if indexedDB is not supported, an iframe cannot be
// notified of the popup sign in result.
return util.isIndexedDBAvailable();
}
return true;
}
}
catch (e) {
// localStorage is not available from a worker. Test availability of
// indexedDB.
return _isWorker() && util.isIndexedDBAvailable();
}
return false;
}
/**
* @param {?Object=} global The optional global scope.
* @return {boolean} Whether current environment is a worker.
*/
function _isWorker() {
// WorkerGlobalScope only defined in worker environment.
return (typeof global !== 'undefined' &&
'WorkerGlobalScope' in global &&
'importScripts' in global);
}
function _isPopupRedirectSupported() {
return ((_isHttpOrHttps() ||
util.isBrowserExtension() ||
_isAndroidOrIosCordovaScheme()) &&
// React Native with remote debugging reports its location.protocol as
// http.
!_isNativeEnvironment() &&
// Local storage has to be supported for browser popup and redirect
// operations to work.
_isWebStorageSupported() &&
// DOM, popups and redirects are not supported within a worker.
!_isWorker());
}
function _getClientPlatform() {
if (util.isNode()) {
return "Node" /* NODE */;
}
if (util.isReactNative()) {
return "ReactNative" /* REACT_NATIVE */;
}
if (_isWorker()) {
return "Worker" /* WORKER */;
}
return "Browser" /* BROWSER */;
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var Persistence = {
LOCAL: 'LOCAL',
NONE: 'NONE',
SESSION: 'SESSION'
};
/**
* Validates that an argument is a valid persistence value. If an invalid type
* is specified, an error is thrown synchronously.
*/
function _validatePersistenceArgument(auth, persistence) {
impl._assert(Object.values(Persistence).includes(persistence), auth, "invalid-persistence-type" /* INVALID_PERSISTENCE */);
// Validate if the specified type is supported in the current environment.
if (util.isReactNative()) {
// This is only supported in a browser.
impl._assert(persistence !== Persistence.SESSION, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;
}
if (util.isNode()) {
// Only none is supported in Node.js.
impl._assert(persistence === Persistence.NONE, auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;
}
if (_isWorker()) {
// In a worker environment, either LOCAL or NONE are supported.
// If indexedDB not supported and LOCAL provided, throw an error
impl._assert(persistence === Persistence.NONE ||
(persistence === Persistence.LOCAL && util.isIndexedDBAvailable()), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
return;
}
// This is restricted by what the browser supports.
impl._assert(persistence === Persistence.NONE || _isWebStorageSupported(), auth, "unsupported-persistence-type" /* UNSUPPORTED_PERSISTENCE */);
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function credentialFromResponse(userCredential) {
var providerId = userCredential.providerId, _tokenResponse = userCredential._tokenResponse;
if (!_tokenResponse) {
return null;
}
// Handle phone Auth credential responses, as they have a different format
// from other backend responses (i.e. no providerId).
if ('temporaryProof' in _tokenResponse && 'phoneNumber' in _tokenResponse) {
return impl.PhoneAuthProvider.credentialFromResult(userCredential);
}
// Email and password is not supported as there is no situation where the
// server would return the password to the client.
if (!providerId || providerId === "password" /* PASSWORD */) {
return null;
}
switch (providerId) {
case "google.com" /* GOOGLE */:
return impl.GoogleAuthProvider.credentialFromResult(userCredential);
case "facebook.com" /* FACEBOOK */:
return impl.FacebookAuthProvider.credentialFromResult(userCredential);
case "github.com" /* GITHUB */:
return impl.GithubAuthProvider.credentialFromResult(userCredential);
case "twitter.com" /* TWITTER */:
return impl.TwitterAuthProvider.credentialFromResult(userCredential);
default:
var _a = _tokenResponse, oauthIdToken = _a.oauthIdToken, oauthAccessToken = _a.oauthAccessToken, oauthTokenSecret = _a.oauthTokenSecret, pendingToken = _a.pendingToken, nonce = _a.nonce;
if (!oauthAccessToken &&
!oauthTokenSecret &&
!oauthIdToken &&
!pendingToken) {
return null;
}
// TODO(avolkovi): uncomment this and get it working with SAML & OIDC
// if (pendingToken) {
// if (providerId.indexOf(compat.constants.SAML_PREFIX) == 0) {
// return new impl.SAMLAuthCredential(providerId, pendingToken);
// } else {
// // OIDC and non-default providers excluding Twitter.
// return new impl.OAuthCredential(
// providerId,
// {
// pendingToken,
// idToken: oauthIdToken,
// accessToken: oauthAccessToken
// },
// providerId);
// }
// }
return new impl.OAuthProvider(providerId).credential({
idToken: oauthIdToken,
accessToken: oauthAccessToken,
rawNonce: nonce
});
}
}
function convertCredential(auth, credentialPromise) {
return tslib.__awaiter(this, void 0, void 0, function () {
var credential, e_1, _a, operationType, user;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_b.trys.push([0, 2, , 3]);
return [4 /*yield*/, credentialPromise];
case 1:
credential = _b.sent();
return [3 /*break*/, 3];
case 2:
e_1 = _b.sent();
if (e_1.code === 'auth/multi-factor-auth-required') {
e_1.resolver = impl.getMultiFactorResolver(auth, e_1);
}
throw e_1;
case 3: return [4 /*yield*/, credential];
case 4:
_a = _b.sent(), operationType = _a.operationType, user = _a.user;
return [2 /*return*/, {
operationType: operationType,
credential: credentialFromResponse(credential),
additionalUserInfo: impl.getAdditionalUserInfo(credential),
user: User.getOrCreate(user)
}];
}
});
});
}
function convertConfirmationResult(auth, confirmationResultPromise) {
return tslib.__awaiter(this, void 0, void 0, function () {
var confirmationResultExp;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, confirmationResultPromise];
case 1:
confirmationResultExp = _a.sent();
return [2 /*return*/, {
verificationId: confirmationResultExp.verificationId,
confirm: function (verificationCode) {
return convertCredential(auth, confirmationResultExp.confirm(verificationCode));
}
}];
}
});
});
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
function unwrap(object) {
return object.unwrap();
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var User = /** @class */ (function () {
function User(user) {
this.user = user;
this.multiFactor = impl.multiFactor(user);
}
User.getOrCreate = function (user) {
if (!User.USER_MAP.has(user)) {
User.USER_MAP.set(user, new User(user));
}
return User.USER_MAP.get(user);
};
User.prototype.delete = function () {
return this.user.delete();
};
User.prototype.reload = function () {
return this.user.reload();
};
User.prototype.toJSON = function () {
return this.user.toJSON();
};
User.prototype.getIdTokenResult = function (forceRefresh) {
return this.user.getIdTokenResult(forceRefresh);
};
User.prototype.getIdToken = function (forceRefresh) {
return this.user.getIdToken(forceRefresh);
};
User.prototype.linkAndRetrieveDataWithCredential = function (credential) {
return this.linkWithCredential(credential);
};
User.prototype.linkWithCredential = function (credential) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2 /*return*/, convertCredential(this.auth, impl.linkWithCredential(this.user, credential))];
});
});
};
User.prototype.linkWithPhoneNumber = function (phoneNumber, applicationVerifier) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2 /*return*/, convertConfirmationResult(this.auth, impl.linkWithPhoneNumber(this.user, phoneNumber, unwrap(applicationVerifier)))];
});
});
};
User.prototype.linkWithPopup = function (provider) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2 /*return*/, convertCredential(this.auth, impl.linkWithPopup(this.user, provider, impl.browserPopupRedirectResolver))];
});
});
};
User.prototype.linkWithRedirect = function (provider) {
return impl.linkWithRedirect(this.user, provider, impl.browserPopupRedirectResolver);
};
User.prototype.reauthenticateAndRetrieveDataWithCredential = function (credential) {
return this.reauthenticateWithCredential(credential);
};
User.prototype.reauthenticateWithCredential = function (credential) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2 /*return*/, convertCredential(this.auth, impl.reauthenticateWithCredential(this.user, credential))];
});
});
};
User.prototype.reauthenticateWithPhoneNumber = function (phoneNumber, applicationVerifier) {
return convertConfirmationResult(this.auth, impl.reauthenticateWithPhoneNumber(this.user, phoneNumber, unwrap(applicationVerifier)));
};
User.prototype.reauthenticateWithPopup = function (provider) {
return convertCredential(this.auth, impl.reauthenticateWithPopup(this.user, provider, impl.browserPopupRedirectResolver));
};
User.prototype.reauthenticateWithRedirect = function (provider) {
return impl.reauthenticateWithRedirect(this.user, provider, impl.browserPopupRedirectResolver);
};
User.prototype.sendEmailVerification = function (actionCodeSettings) {
return impl.sendEmailVerification(this.user, actionCodeSettings);
};
User.prototype.unlink = function (providerId) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, impl.unlink(this.user, providerId)];
case 1:
_a.sent();
return [2 /*return*/, this];
}
});
});
};
User.prototype.updateEmail = function (newEmail) {
return impl.updateEmail(this.user, newEmail);
};
User.prototype.updatePassword = function (newPassword) {
return impl.updatePassword(this.user, newPassword);
};
User.prototype.updatePhoneNumber = function (phoneCredential) {
return impl.updatePhoneNumber(this.user, phoneCredential);
};
User.prototype.updateProfile = function (profile) {
return impl.updateProfile(this.user, profile);
};
User.prototype.verifyBeforeUpdateEmail = function (newEmail, actionCodeSettings) {
return impl.verifyBeforeUpdateEmail(this.user, newEmail, actionCodeSettings);
};
User.prototype.unwrap = function () {
return this.user;
};
Object.defineProperty(User.prototype, "emailVerified", {
get: function () {
return this.user.emailVerified;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "isAnonymous", {
get: function () {
return this.user.isAnonymous;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "metadata", {
get: function () {
return this.user.metadata;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "phoneNumber", {
get: function () {
return this.user.phoneNumber;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "providerData", {
get: function () {
return this.user.providerData;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "refreshToken", {
get: function () {
return this.user.refreshToken;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "tenantId", {
get: function () {
return this.user.tenantId;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "displayName", {
get: function () {
return this.user.displayName;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "email", {
get: function () {
return this.user.email;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "photoURL", {
get: function () {
return this.user.photoURL;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "providerId", {
get: function () {
return this.user.providerId;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "uid", {
get: function () {
return this.user.uid;
},
enumerable: false,
configurable: true
});
Object.defineProperty(User.prototype, "auth", {
get: function () {
return this.user.auth;
},
enumerable: false,
configurable: true
});
// Maintain a map so that there's always a 1:1 mapping between new User and
// legacy compat users
User.USER_MAP = new WeakMap();
return User;
}());
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var PERSISTENCE_KEY = 'persistence';
var _assert = impl._assert;
var Auth = /** @class */ (function () {
// private readonly auth: impl.AuthImpl;
function Auth(app, auth) {
this.app = app;
this.auth = auth;
var apiKey = app.options.apiKey;
if (this.auth._deleted) {
return;
}
// Note this is slightly different behavior: in this case, the stored
// persistence is checked *first* rather than last. This is because we want
// the fallback (if no user is found) to be the stored persistence type
var storedPersistence = this.getPersistenceFromRedirect();
var persistences = storedPersistence ? [storedPersistence] : [];
persistences.push(impl.indexedDBLocalPersistence);
// TODO(avolkovi): Implement proper persistence fallback
var hierarchy = persistences.map(impl._getInstance);
// TODO: platform needs to be determined using heuristics
_assert(apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name
});
this.auth._updateErrorMap(impl.debugErrorMap);
// This promise is intended to float; auth initialization happens in the
// background, meanwhile the auth object may be used by the app.
// eslint-disable-next-line @typescript-eslint/no-floating-promises
this.auth._initializeWithPersistence(hierarchy, impl.browserPopupRedirectResolver);
}
Object.defineProperty(Auth.prototype, "currentUser", {
get: function () {
if (!this.auth.currentUser) {
return null;
}
return User.getOrCreate(this.auth.currentUser);
},
enumerable: false,
configurable: true
});
Object.defineProperty(Auth.prototype, "languageCode", {
get: function () {
return this.auth.languageCode;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Auth.prototype, "settings", {
get: function () {
return this.auth.settings;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Auth.prototype, "tenantId", {
get: function () {
return this.auth.tenantId;
},
enumerable: false,
configurable: true
});
Auth.prototype.useDeviceLanguage = function () {
this.auth.useDeviceLanguage();
};
Auth.prototype.signOut = function () {
return this.auth.signOut();
};
Auth.prototype.useEmulator = function (url, options) {
this.auth.useEmulator(url, options);
};
Auth.prototype.applyActionCode = function (code) {
return impl.applyActionCode(this.auth, code);
};
Auth.prototype.checkActionCode = function (code) {
return impl.checkActionCode(this.auth, code);
};
Auth.prototype.confirmPasswordReset = function (code, newPassword) {
return impl.confirmPasswordReset(this.auth, code, newPassword);
};
Auth.prototype.createUserWithEmailAndPassword = function (email, password) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
return [2 /*return*/, convertCredential(this.auth, impl.createUserWithEmailAndPassword(this.auth, email, password))];
});
});
};
Auth.prototype.fetchProvidersForEmail = function (email) {
return this.fetchSignInMethodsForEmail(email);
};
Auth.prototype.fetchSignInMethodsForEmail = function (email) {
return impl.fetchSignInMethodsForEmail(this.auth, email);
};
Auth.prototype.isSignInWithEmailLink = function (emailLink) {
return impl.isSignInWithEmailLink(this.auth, emailLink);
};
Auth.prototype.getRedirectResult = function () {
return tslib.__awaiter(this, void 0, void 0, function () {
var credential;
return tslib.__generator(this, function (_a) {
switch (_a.label) {
case 0:
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [4 /*yield*/, impl.getRedirectResult(this.auth, impl.browserPopupRedirectResolver)];
case 1:
credential = _a.sent();
if (!credential) {
return [2 /*return*/, {
credential: null,
user: null
}];
}
return [2 /*return*/, convertCredential(this.auth, Promise.resolve(credential))];
}
});
});
};
Auth.prototype.onAuthStateChanged = function (nextOrObserver, errorFn, completed) {
var _a = wrapObservers(nextOrObserver, errorFn, completed), next = _a.next, error = _a.error, complete = _a.complete;
return this.auth.onAuthStateChanged(next, error, complete);
};
Auth.prototype.onIdTokenChanged = function (nextOrObserver, errorFn, completed) {
var _a = wrapObservers(nextOrObserver, errorFn, completed), next = _a.next, error = _a.error, complete = _a.complete;
return this.auth.onIdTokenChanged(next, error, complete);
};
Auth.prototype.sendSignInLinkToEmail = function (email, actionCodeSettings) {
return impl.sendSignInLinkToEmail(this.auth, email, actionCodeSettings);
};
Auth.prototype.sendPasswordResetEmail = function (email, actionCodeSettings) {
return impl.sendPasswordResetEmail(this.auth, email, actionCodeSettings || undefined);
};
Auth.prototype.setPersistence = function (persistence) {
return tslib.__awaiter(this, void 0, void 0, function () {
function convertPersistence(auth, persistenceCompat) {
_validatePersistenceArgument(auth, persistence);
switch (persistenceCompat) {
case Persistence.SESSION:
return impl.browserSessionPersistence;
case Persistence.LOCAL:
return util.isIndexedDBAvailable()
? impl.indexedDBLocalPersistence
: impl.browserLocalPersistence;
case Persistence.NONE:
return impl.inMemoryPersistence;
default:
return impl._fail("argument-error" /* ARGUMENT_ERROR */, {
appName: auth.name
});
}
}
return tslib.__generator(this, function (_a) {
return [2 /*return*/, this.auth.setPersistence(convertPersistence(this.auth, persistence))];
});
});
};
Auth.prototype.signInAndRetrieveDataWithCredential = function (credential) {
return this.signInWithCredential(credential);
};
Auth.prototype.signInAnonymously = function () {
return convertCredential(this.auth, impl.signInAnonymously(this.auth));
};
Auth.prototype.signInWithCredential = function (credential) {
return convertCredential(this.auth, impl.signInWithCredential(this.auth, credential));
};
Auth.prototype.signInWithCustomToken = function (token) {
return convertCredential(this.auth, impl.signInWithCustomToken(this.auth, token));
};
Auth.prototype.signInWithEmailAndPassword = function (email, password) {
return convertCredential(this.auth, impl.signInWithEmailAndPassword(this.auth, email, password));
};
Auth.prototype.signInWithEmailLink = function (email, emailLink) {
return convertCredential(this.auth, impl.signInWithEmailLink(this.auth, email, emailLink));
};
Auth.prototype.signInWithPhoneNumber = function (phoneNumber, applicationVerifier) {
return convertConfirmationResult(this.auth, impl.signInWithPhoneNumber(this.auth, phoneNumber, unwrap(applicationVerifier)));
};
Auth.prototype.signInWithPopup = function (provider) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
return [2 /*return*/, convertCredential(this.auth, impl.signInWithPopup(this.auth, provider, impl.browserPopupRedirectResolver))];
});
});
};
Auth.prototype.signInWithRedirect = function (provider) {
return tslib.__awaiter(this, void 0, void 0, function () {
return tslib.__generator(this, function (_a) {
_assert(_isPopupRedirectSupported(), this.auth, "operation-not-supported-in-this-environment" /* OPERATION_NOT_SUPPORTED */);
this.savePersistenceForRedirect();
return [2 /*return*/, impl.signInWithRedirect(this.auth, provider, impl.browserPopupRedirectResolver)];
});
});
};
Auth.prototype.updateCurrentUser = function (user) {
return this.auth.updateCurrentUser(unwrap(user));
};
Auth.prototype.verifyPasswordResetCode = function (code) {
return impl.verifyPasswordResetCode(this.auth, code);
};
Auth.prototype.unwrap = function () {
return this.auth;
};
Auth.prototype._delete = function () {
return this.auth._delete();
};
Auth.prototype.savePersistenceForRedirect = function () {
var win = getSelfWindow();
var key = impl._persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
if (win === null || win === void 0 ? void 0 : win.sessionStorage) {
win.sessionStorage.setItem(key, this.auth._getPersistence());
}
};
Auth.prototype.getPersistenceFromRedirect = function () {
var win = getSelfWindow();
if (!(win === null || win === void 0 ? void 0 : win.sessionStorage)) {
return null;
}
var key = impl._persistenceKeyName(PERSISTENCE_KEY, this.auth.config.apiKey, this.auth.name);
var persistence = win.sessionStorage.getItem(key);
switch (persistence) {
case impl.inMemoryPersistence.type:
return impl.inMemoryPersistence;
case impl.indexedDBLocalPersistence.type:
return impl.indexedDBLocalPersistence;
case impl.browserSessionPersistence.type:
return impl.browserSessionPersistence;
case impl.browserLocalPersistence.type:
return impl.browserLocalPersistence;
default:
return null;
}
};
return Auth;
}());
function getSelfWindow() {
return typeof window !== 'undefined' ? window : null;
}
function wrapObservers(nextOrObserver, error, complete) {
var next = nextOrObserver;
if (typeof nextOrObserver !== 'function') {
(next = nextOrObserver.next, error = nextOrObserver.error, complete = nextOrObserver.complete);
}
// We know 'next' is now a function
var oldNext = next;
var newNext = function (user) {
return oldNext(user && User.getOrCreate(user));
};
return {
next: newNext,
error: error,
complete: complete
};
}
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var PhoneAuthProvider = /** @class */ (function () {
function PhoneAuthProvider() {
this.providerId = 'phone';
this.phoneProvider = new impl.PhoneAuthProvider(unwrap(firebase__default['default'].auth()));
}
PhoneAuthProvider.credential = function (verificationId, verificationCode) {
return impl.PhoneAuthProvider.credential(verificationId, verificationCode);
};
PhoneAuthProvider.prototype.verifyPhoneNumber = function (phoneInfoOptions, applicationVerifier) {
return this.phoneProvider.verifyPhoneNumber(
// The implementation matches but the types are subtly incompatible
// eslint-disable-next-line @typescript-eslint/no-explicit-any
phoneInfoOptions, unwrap(applicationVerifier));
};
PhoneAuthProvider.prototype.unwrap = function () {
return this.phoneProvider;
};
PhoneAuthProvider.PHONE_SIGN_IN_METHOD = impl.PhoneAuthProvider.PHONE_SIGN_IN_METHOD;
PhoneAuthProvider.PROVIDER_ID = impl.PhoneAuthProvider.PROVIDER_ID;
return PhoneAuthProvider;
}());
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var _assert$1 = impl._assert;
var RecaptchaVerifier = /** @class */ (function () {
function RecaptchaVerifier(container, parameters, app) {
if (app === void 0) { app = firebase__default['default'].app(); }
var _a;
// API key is required for web client RPC calls.
_assert$1((_a = app.options) === null || _a === void 0 ? void 0 : _a.apiKey, "invalid-api-key" /* INVALID_API_KEY */, {
appName: app.name
});
this.verifier = new impl.RecaptchaVerifier(container,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parameters, unwrap(app.auth()));
this.type = this.verifier.type;
}
RecaptchaVerifier.prototype.clear = function () {
this.verifier.clear();
};
RecaptchaVerifier.prototype.render = function () {
return this.verifier.render();
};
RecaptchaVerifier.prototype.verify = function () {
return this.verifier.verify();
};
RecaptchaVerifier.prototype.unwrap = function () {
return this.verifier;
};
return RecaptchaVerifier;
}());
/**
* @license
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var AUTH_TYPE = 'auth';
// Create auth components to register with firebase.
// Provides Auth public APIs.
function registerAuthCompat(instance) {
instance.INTERNAL.registerComponent(new component.Component(AUTH_TYPE, function (container) {
// getImmediate for FirebaseApp will always succeed
var app = container.getProvider('app').getImmediate();
var auth = container.getProvider('auth-exp').getImmediate();
return new Auth(app, auth);
}, "PUBLIC" /* PUBLIC */)
.setServiceProps({
ActionCodeInfo: {
Operation: {
EMAIL_SIGNIN: "EMAIL_SIGNIN" /* EMAIL_SIGNIN */,
PASSWORD_RESET: "PASSWORD_RESET" /* PASSWORD_RESET */,
RECOVER_EMAIL: "RECOVER_EMAIL" /* RECOVER_EMAIL */,
REVERT_SECOND_FACTOR_ADDITION: "REVERT_SECOND_FACTOR_ADDITION" /* REVERT_SECOND_FACTOR_ADDITION */,
VERIFY_AND_CHANGE_EMAIL: "VERIFY_AND_CHANGE_EMAIL" /* VERIFY_AND_CHANGE_EMAIL */,
VERIFY_EMAIL: "VERIFY_EMAIL" /* VERIFY_EMAIL */
}
},
EmailAuthProvider: impl.EmailAuthProvider,
FacebookAuthProvider: impl.FacebookAuthProvider,
GithubAuthProvider: impl.GithubAuthProvider,
GoogleAuthProvider: impl.GoogleAuthProvider,
OAuthProvider: impl.OAuthProvider,
// SAMLAuthProvider,
PhoneAuthProvider: PhoneAuthProvider,
PhoneMultiFactorGenerator: impl.PhoneMultiFactorGenerator,
RecaptchaVerifier: RecaptchaVerifier,
TwitterAuthProvider: impl.TwitterAuthProvider,
Auth: {
Persistence: Persistence
},
AuthCredential: impl.AuthCredential
// 'Error': fireauth.AuthError
})
.setInstantiationMode("LAZY" /* LAZY */)
.setMultipleInstances(false));
instance.registerVersion('auth', version);
}
impl.registerAuth(_getClientPlatform());
registerAuthCompat(firebase__default['default']);
exp.FetchProvider.initialize(fetchImpl__default['default'], fetchImpl.Headers, fetchImpl.Response);
//# sourceMappingURL=index.node.cjs.js.map
{
"name": "@firebase/auth-compat",
"version": "0.0.900-exp.f18a6d41d",
"version": "0.0.900-exp.f8e97019f",
"private": false,

@@ -25,14 +25,17 @@ "description": "FirebaseAuth compatibility package that uses API style compatible with Firebase@7 and prior versions",

"test:browser": "karma start --single-run",
"test:node": "TS_NODE_COMPILER_OPTIONS='{\"module\":\"commonjs\"}' nyc --reporter lcovonly -- mocha src/**/*.test.* --config ../../config/mocharc.node.js"
"test:browser:integration": "karma start --single-run --integration",
"test:node": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts",
"test:node:integration": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration",
"test:integration": "run-s test:browser:integration test:node:integration"
},
"peerDependencies": {
"@firebase/app-compat": "0.0.900-exp.f18a6d41d",
"@firebase/app-types": "0.x"
"@firebase/app-compat": "0.0.900-exp.f8e97019f"
},
"dependencies": {
"@firebase/auth-types": "0.0.900-exp.f18a6d41d",
"@firebase/auth": "0.0.900-exp.f18a6d41d",
"@firebase/component": "0.1.21",
"@firebase/util": "0.3.4",
"tslib": "^1.11.1"
"@firebase/auth-types": "0.10.2",
"@firebase/auth": "0.0.900-exp.f8e97019f",
"@firebase/component": "0.2.1",
"@firebase/util": "0.4.0",
"node-fetch": "2.6.1",
"tslib": "^2.1.0"
},

@@ -46,3 +49,3 @@ "license": "Apache-2.0",

"rollup-plugin-typescript2": "0.29.0",
"typescript": "4.0.5"
"typescript": "4.2.2"
},

@@ -57,3 +60,3 @@ "repository": {

},
"typings": "dist/index.d.ts",
"typings": "dist/auth-compat-exp/index.d.ts",
"nyc": {

@@ -60,0 +63,0 @@ "extension": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc