@firebase/auth 0.21.5 → 0.21.6-canary.45a55330e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +25 -0
- package/dist/auth-public.d.ts +135 -4
- package/dist/auth.d.ts +138 -4
- package/dist/browser-cjs/{index-ff477525.js → index-3e63d976.js} +180 -5
- package/dist/browser-cjs/index-3e63d976.js.map +1 -0
- package/dist/browser-cjs/index.d.ts +2 -1
- package/dist/browser-cjs/index.js +3 -1
- package/dist/browser-cjs/index.js.map +1 -1
- package/dist/browser-cjs/internal.js +3 -1
- package/dist/browser-cjs/internal.js.map +1 -1
- package/dist/browser-cjs/src/api/account_management/mfa.d.ts +38 -4
- package/dist/browser-cjs/src/api/authentication/mfa.d.ts +11 -0
- package/dist/browser-cjs/src/core/errors.d.ts +1 -0
- package/dist/browser-cjs/src/core/index.d.ts +1 -0
- package/dist/browser-cjs/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/browser-cjs/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/browser-cjs/src/mfa/mfa_info.d.ts +5 -1
- package/dist/browser-cjs/src/model/enum_maps.d.ts +1 -0
- package/dist/browser-cjs/src/model/public_types.d.ts +18 -1
- package/dist/browser-cjs/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/browser-cjs/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/cordova/index.d.ts +2 -1
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +179 -3
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-a4d3c436.js → popup_redirect-4dd66477.js} +31 -6
- package/dist/cordova/popup_redirect-4dd66477.js.map +1 -0
- package/dist/cordova/src/api/account_management/mfa.d.ts +38 -4
- package/dist/cordova/src/api/authentication/mfa.d.ts +11 -0
- package/dist/cordova/src/core/errors.d.ts +1 -0
- package/dist/cordova/src/core/index.d.ts +1 -0
- package/dist/cordova/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/cordova/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/cordova/src/mfa/mfa_info.d.ts +5 -1
- package/dist/cordova/src/model/enum_maps.d.ts +1 -0
- package/dist/cordova/src/model/public_types.d.ts +18 -1
- package/dist/cordova/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/cordova/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/esm2017/{index-3363a72a.js → index-c8153924.js} +179 -6
- package/dist/esm2017/index-c8153924.js.map +1 -0
- package/dist/esm2017/index.d.ts +2 -1
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/account_management/mfa.d.ts +38 -4
- package/dist/esm2017/src/api/authentication/mfa.d.ts +11 -0
- package/dist/esm2017/src/core/errors.d.ts +1 -0
- package/dist/esm2017/src/core/index.d.ts +1 -0
- package/dist/esm2017/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/esm2017/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/esm2017/src/mfa/mfa_info.d.ts +5 -1
- package/dist/esm2017/src/model/enum_maps.d.ts +1 -0
- package/dist/esm2017/src/model/public_types.d.ts +18 -1
- package/dist/esm2017/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/esm2017/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/esm5/{index-3f05dc7b.js → index-f3279380.js} +207 -6
- package/dist/esm5/index-f3279380.js.map +1 -0
- package/dist/esm5/index.d.ts +2 -1
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/account_management/mfa.d.ts +38 -4
- package/dist/esm5/src/api/authentication/mfa.d.ts +11 -0
- package/dist/esm5/src/core/errors.d.ts +1 -0
- package/dist/esm5/src/core/index.d.ts +1 -0
- package/dist/esm5/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/esm5/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/esm5/src/mfa/mfa_info.d.ts +5 -1
- package/dist/esm5/src/model/enum_maps.d.ts +1 -0
- package/dist/esm5/src/model/public_types.d.ts +18 -1
- package/dist/esm5/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/esm5/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.webworker.esm5.js +23 -4
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.d.ts +2 -1
- package/dist/node/index.js +83 -81
- package/dist/node/index.js.map +1 -1
- package/dist/node/internal.js +144 -142
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/api/account_management/mfa.d.ts +38 -4
- package/dist/node/src/api/authentication/mfa.d.ts +11 -0
- package/dist/node/src/core/errors.d.ts +1 -0
- package/dist/node/src/core/index.d.ts +1 -0
- package/dist/node/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/node/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/node/src/mfa/mfa_info.d.ts +5 -1
- package/dist/node/src/model/enum_maps.d.ts +1 -0
- package/dist/node/src/model/public_types.d.ts +18 -1
- package/dist/node/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/node/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/node/{index-45468d80.js → totp-9c98f1ff.js} +243 -6
- package/dist/node/totp-9c98f1ff.js.map +1 -0
- package/dist/node-esm/index.d.ts +2 -1
- package/dist/node-esm/index.js +2 -2
- package/dist/node-esm/internal.js +3 -3
- package/dist/node-esm/src/api/account_management/mfa.d.ts +38 -4
- package/dist/node-esm/src/api/authentication/mfa.d.ts +11 -0
- package/dist/node-esm/src/core/errors.d.ts +1 -0
- package/dist/node-esm/src/core/index.d.ts +1 -0
- package/dist/node-esm/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/node-esm/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/node-esm/src/mfa/mfa_info.d.ts +5 -1
- package/dist/node-esm/src/model/enum_maps.d.ts +1 -0
- package/dist/node-esm/src/model/public_types.d.ts +18 -1
- package/dist/node-esm/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/node-esm/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/node-esm/{index-1f9492de.js → totp-a3bfc07a.js} +213 -7
- package/dist/node-esm/totp-a3bfc07a.js.map +1 -0
- package/dist/rn/index.d.ts +2 -1
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +176 -1
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-e7bf48a1.js → phone-588b1f48.js} +37 -5
- package/dist/rn/phone-588b1f48.js.map +1 -0
- package/dist/rn/src/api/account_management/mfa.d.ts +38 -4
- package/dist/rn/src/api/authentication/mfa.d.ts +11 -0
- package/dist/rn/src/core/errors.d.ts +1 -0
- package/dist/rn/src/core/index.d.ts +1 -0
- package/dist/rn/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/rn/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/rn/src/mfa/mfa_info.d.ts +5 -1
- package/dist/rn/src/model/enum_maps.d.ts +1 -0
- package/dist/rn/src/model/public_types.d.ts +18 -1
- package/dist/rn/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/rn/test/integration/flows/totp.test.d.ts +17 -0
- package/dist/src/api/account_management/mfa.d.ts +38 -4
- package/dist/src/api/authentication/mfa.d.ts +11 -0
- package/dist/src/core/errors.d.ts +1 -0
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/mfa/assertions/totp.d.ts +124 -0
- package/dist/src/mfa/assertions/totp.test.d.ts +17 -0
- package/dist/src/mfa/mfa_info.d.ts +5 -1
- package/dist/src/model/enum_maps.d.ts +1 -0
- package/dist/src/model/public_types.d.ts +18 -1
- package/dist/test/helpers/integration/helpers.d.ts +3 -0
- package/dist/test/integration/flows/totp.test.d.ts +17 -0
- package/package.json +10 -8
- package/dist/browser-cjs/index-ff477525.js.map +0 -1
- package/dist/cordova/popup_redirect-a4d3c436.js.map +0 -1
- package/dist/esm2017/index-3363a72a.js.map +0 -1
- package/dist/esm5/index-3f05dc7b.js.map +0 -1
- package/dist/node/index-45468d80.js.map +0 -1
- package/dist/node-esm/index-1f9492de.js.map +0 -1
- package/dist/rn/phone-e7bf48a1.js.map +0 -1
|
@@ -1028,6 +1028,7 @@ function _debugErrorMap() {
|
|
|
1028
1028
|
_a["missing-or-invalid-nonce" /* AuthErrorCode.MISSING_OR_INVALID_NONCE */] = 'The request does not contain a valid nonce. This can occur if the ' +
|
|
1029
1029
|
'SHA-256 hash of the provided raw nonce does not match the hashed nonce ' +
|
|
1030
1030
|
'in the ID token payload.',
|
|
1031
|
+
_a["missing-password" /* AuthErrorCode.MISSING_PASSWORD */] = 'A non-empty password must be provided',
|
|
1031
1032
|
_a["missing-multi-factor-info" /* AuthErrorCode.MISSING_MFA_INFO */] = 'No second factor identifier is provided.',
|
|
1032
1033
|
_a["missing-multi-factor-session" /* AuthErrorCode.MISSING_MFA_SESSION */] = 'The request is missing proof of first factor successful sign-in.',
|
|
1033
1034
|
_a["missing-phone-number" /* AuthErrorCode.MISSING_PHONE_NUMBER */] = 'To send verification codes, provide a phone number for the recipient.',
|
|
@@ -1682,7 +1683,7 @@ var SERVER_ERROR_MAP = (_a$1 = {},
|
|
|
1682
1683
|
// Sign in with email and password errors (some apply to sign up too).
|
|
1683
1684
|
_a$1["INVALID_PASSWORD" /* ServerError.INVALID_PASSWORD */] = "wrong-password" /* AuthErrorCode.INVALID_PASSWORD */,
|
|
1684
1685
|
// This can only happen if the SDK sends a bad request.
|
|
1685
|
-
_a$1["MISSING_PASSWORD" /* ServerError.MISSING_PASSWORD */] = "
|
|
1686
|
+
_a$1["MISSING_PASSWORD" /* ServerError.MISSING_PASSWORD */] = "missing-password" /* AuthErrorCode.MISSING_PASSWORD */,
|
|
1686
1687
|
// Sign up with email and password errors.
|
|
1687
1688
|
_a$1["EMAIL_EXISTS" /* ServerError.EMAIL_EXISTS */] = "email-already-in-use" /* AuthErrorCode.EMAIL_EXISTS */,
|
|
1688
1689
|
_a$1["PASSWORD_LOGIN_DISABLED" /* ServerError.PASSWORD_LOGIN_DISABLED */] = "operation-not-allowed" /* AuthErrorCode.OPERATION_NOT_ALLOWED */,
|
|
@@ -1851,7 +1852,10 @@ function _performFetchWithErrorHandling(auth, customErrorMap, fetchFn) {
|
|
|
1851
1852
|
if (e_1 instanceof FirebaseError) {
|
|
1852
1853
|
throw e_1;
|
|
1853
1854
|
}
|
|
1854
|
-
|
|
1855
|
+
// Changing this to a different error code will log user out when there is a network error
|
|
1856
|
+
// because we treat any error other than NETWORK_REQUEST_FAILED as token is invalid.
|
|
1857
|
+
// https://github.com/firebase/firebase-js-sdk/blob/4fbc73610d70be4e0852e7de63a39cb7897e8546/packages/auth/src/core/auth/auth_impl.ts#L309-L316
|
|
1858
|
+
_fail(auth, "network-request-failed" /* AuthErrorCode.NETWORK_REQUEST_FAILED */, { 'message': String(e_1) });
|
|
1855
1859
|
return [3 /*break*/, 5];
|
|
1856
1860
|
case 5: return [2 /*return*/];
|
|
1857
1861
|
}
|
|
@@ -6514,6 +6518,9 @@ var MultiFactorInfoImpl = /** @class */ (function () {
|
|
|
6514
6518
|
if ('phoneInfo' in enrollment) {
|
|
6515
6519
|
return PhoneMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
|
|
6516
6520
|
}
|
|
6521
|
+
else if ('totpInfo' in enrollment) {
|
|
6522
|
+
return TotpMultiFactorInfoImpl._fromServerResponse(auth, enrollment);
|
|
6523
|
+
}
|
|
6517
6524
|
return _fail(auth, "internal-error" /* AuthErrorCode.INTERNAL_ERROR */);
|
|
6518
6525
|
};
|
|
6519
6526
|
return MultiFactorInfoImpl;
|
|
@@ -6529,6 +6536,16 @@ var PhoneMultiFactorInfoImpl = /** @class */ (function (_super) {
|
|
|
6529
6536
|
return new PhoneMultiFactorInfoImpl(enrollment);
|
|
6530
6537
|
};
|
|
6531
6538
|
return PhoneMultiFactorInfoImpl;
|
|
6539
|
+
}(MultiFactorInfoImpl));
|
|
6540
|
+
var TotpMultiFactorInfoImpl = /** @class */ (function (_super) {
|
|
6541
|
+
__extends(TotpMultiFactorInfoImpl, _super);
|
|
6542
|
+
function TotpMultiFactorInfoImpl(response) {
|
|
6543
|
+
return _super.call(this, "totp" /* FactorId.TOTP */, response) || this;
|
|
6544
|
+
}
|
|
6545
|
+
TotpMultiFactorInfoImpl._fromServerResponse = function (_auth, enrollment) {
|
|
6546
|
+
return new TotpMultiFactorInfoImpl(enrollment);
|
|
6547
|
+
};
|
|
6548
|
+
return TotpMultiFactorInfoImpl;
|
|
6532
6549
|
}(MultiFactorInfoImpl));
|
|
6533
6550
|
|
|
6534
6551
|
/**
|
|
@@ -7495,6 +7512,7 @@ function setPersistence(auth, persistence) {
|
|
|
7495
7512
|
*
|
|
7496
7513
|
* @remarks
|
|
7497
7514
|
* This includes sign-in, sign-out, and token refresh events.
|
|
7515
|
+
* This will not be triggered automatically upon ID token expiration. Use {@link User.getIdToken} to refresh the ID token.
|
|
7498
7516
|
*
|
|
7499
7517
|
* @param auth - The {@link Auth} instance.
|
|
7500
7518
|
* @param nextOrObserver - callback triggered on change.
|
|
@@ -7757,6 +7775,12 @@ function startEnrollPhoneMfa(auth, request) {
|
|
|
7757
7775
|
function finalizeEnrollPhoneMfa(auth, request) {
|
|
7758
7776
|
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaEnrollment:finalize" /* Endpoint.FINALIZE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));
|
|
7759
7777
|
}
|
|
7778
|
+
function startEnrollTotpMfa(auth, request) {
|
|
7779
|
+
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaEnrollment:start" /* Endpoint.START_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));
|
|
7780
|
+
}
|
|
7781
|
+
function finalizeEnrollTotpMfa(auth, request) {
|
|
7782
|
+
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaEnrollment:finalize" /* Endpoint.FINALIZE_MFA_ENROLLMENT */, _addTidIfNecessary(auth, request));
|
|
7783
|
+
}
|
|
7760
7784
|
function withdrawMfa(auth, request) {
|
|
7761
7785
|
return _performApiRequest(auth, "POST" /* HttpMethod.POST */, "/v2/accounts/mfaEnrollment:withdraw" /* Endpoint.WITHDRAW_MFA */, _addTidIfNecessary(auth, request));
|
|
7762
7786
|
}
|
|
@@ -7887,7 +7911,7 @@ function multiFactor(user) {
|
|
|
7887
7911
|
}
|
|
7888
7912
|
|
|
7889
7913
|
var name = "@firebase/auth";
|
|
7890
|
-
var version = "0.21.
|
|
7914
|
+
var version = "0.21.6-canary.45a55330e";
|
|
7891
7915
|
|
|
7892
7916
|
/**
|
|
7893
7917
|
* @license
|
|
@@ -8073,7 +8097,8 @@ function registerAuth(clientPlatform) {
|
|
|
8073
8097
|
*/
|
|
8074
8098
|
var FactorId = {
|
|
8075
8099
|
/** Phone as second factor */
|
|
8076
|
-
PHONE: 'phone'
|
|
8100
|
+
PHONE: 'phone',
|
|
8101
|
+
TOTP: 'totp'
|
|
8077
8102
|
};
|
|
8078
8103
|
/**
|
|
8079
8104
|
* Enumeration of supported providers.
|
|
@@ -10068,5 +10093,5 @@ function generateNoEvent() {
|
|
|
10068
10093
|
};
|
|
10069
10094
|
}
|
|
10070
10095
|
|
|
10071
|
-
export { signInWithEmailLink as $, ActionCodeOperation as A, FacebookAuthProvider as B, GithubAuthProvider as C, OAuthProvider as D, EmailAuthCredential as E, FactorId as F, GoogleAuthProvider as G, SAMLAuthProvider as H, signInAnonymously as I, signInWithCredential as J, linkWithCredential as K, reauthenticateWithCredential as L, signInWithCustomToken as M, sendPasswordResetEmail as N, OperationType as O, ProviderId as P, confirmPasswordReset as Q, applyActionCode as R, SignInMethod as S, TwitterAuthProvider as T, checkActionCode as U, verifyPasswordResetCode as V, createUserWithEmailAndPassword as W, signInWithEmailAndPassword as X, sendSignInLinkToEmail as Y, isSignInWithEmailLink as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, fetchSignInMethodsForEmail as a0, sendEmailVerification as a1, verifyBeforeUpdateEmail as a2, ActionCodeURL as a3, parseActionCodeURL as a4, updateProfile as a5, updateEmail as a6, updatePassword as a7, getIdToken as a8, getIdTokenResult as a9, _getCurrentUrl as aA, _emulatorUrl as aB, _isChromeIOS as aC, _isFirefox as aD, _isIOSStandalone as aE, _getRedirectUrl as aF, _setWindowLocation as aG, _isMobileBrowser as aH, _isSafari as aI, _isIOS as aJ, _getRedirectResult as aK, _overrideRedirectResult as aL, AuthEventManager as aM, debugFail as aN, finalizeEnrollPhoneMfa as aO,
|
|
10072
|
-
//# sourceMappingURL=popup_redirect-
|
|
10096
|
+
export { signInWithEmailLink as $, ActionCodeOperation as A, FacebookAuthProvider as B, GithubAuthProvider as C, OAuthProvider as D, EmailAuthCredential as E, FactorId as F, GoogleAuthProvider as G, SAMLAuthProvider as H, signInAnonymously as I, signInWithCredential as J, linkWithCredential as K, reauthenticateWithCredential as L, signInWithCustomToken as M, sendPasswordResetEmail as N, OperationType as O, ProviderId as P, confirmPasswordReset as Q, applyActionCode as R, SignInMethod as S, TwitterAuthProvider as T, checkActionCode as U, verifyPasswordResetCode as V, createUserWithEmailAndPassword as W, signInWithEmailAndPassword as X, sendSignInLinkToEmail as Y, isSignInWithEmailLink as Z, _signInWithRedirect as _, _reauthenticateWithRedirect as a, fetchSignInMethodsForEmail as a0, sendEmailVerification as a1, verifyBeforeUpdateEmail as a2, ActionCodeURL as a3, parseActionCodeURL as a4, updateProfile as a5, updateEmail as a6, updatePassword as a7, getIdToken as a8, getIdTokenResult as a9, _getCurrentUrl as aA, _emulatorUrl as aB, _isChromeIOS as aC, _isFirefox as aD, _isIOSStandalone as aE, _getRedirectUrl as aF, _setWindowLocation as aG, _isMobileBrowser as aH, _isSafari as aI, _isIOS as aJ, _getRedirectResult as aK, _overrideRedirectResult as aL, AuthEventManager as aM, debugFail as aN, finalizeEnrollPhoneMfa as aO, finalizeEnrollTotpMfa as aP, startEnrollTotpMfa as aQ, _persistenceKeyName as aR, UserImpl as aS, _getInstance as aT, AuthImpl as aU, _getClientVersion as aV, FetchProvider as aW, SAMLAuthCredential as aX, signInWithRedirect as aY, linkWithRedirect as aZ, reauthenticateWithRedirect as a_, unlink as aa, getAdditionalUserInfo as ab, reload as ac, getMultiFactorResolver as ad, multiFactor as ae, _performApiRequest as af, _addTidIfNecessary as ag, _createError as ah, _assert as ai, Delay as aj, _window as ak, _isHttpOrHttps as al, _isWorker as am, _castAuth as an, _assertLinkedStatus as ao, sendPhoneVerificationCode as ap, startEnrollPhoneMfa as aq, _link$1 as ar, debugAssert as as, _generateEventId as at, AbstractPopupRedirectOperation as au, _assertInstanceOf as av, _withDefaultResolver as aw, FederatedAuthProvider as ax, _fail as ay, _getProjectConfig as az, _linkWithRedirect as b, indexedDBLocalPersistence as c, cordovaPopupRedirectResolver as d, browserLocalPersistence as e, browserSessionPersistence as f, getRedirectResult as g, beforeAuthStateChanged as h, initializeAuth as i, onAuthStateChanged as j, updateCurrentUser as k, signOut as l, deleteUser as m, debugErrorMap as n, onIdTokenChanged as o, prodErrorMap as p, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as q, registerAuth as r, setPersistence as s, connectAuthEmulator as t, useDeviceLanguage as u, AuthCredential as v, OAuthCredential as w, PhoneAuthCredential as x, inMemoryPersistence as y, EmailAuthProvider as z };
|
|
10097
|
+
//# sourceMappingURL=popup_redirect-4dd66477.js.map
|