@firebase/auth 0.22.0-canary.852ded64d → 0.22.0-canary.ea3849fff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.d.ts +1 -0
- package/dist/browser-cjs/{index-845ba5cf.js → index-a4932583.js} +62 -26
- package/dist/browser-cjs/index-a4932583.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/browser-cjs/src/api/index.d.ts +2 -1
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/browser-cjs/src/core/util/handler.d.ts +1 -1
- package/dist/browser-cjs/src/core/util/log.d.ts +1 -0
- package/dist/browser-cjs/src/model/auth.d.ts +1 -0
- package/dist/browser-cjs/test/helpers/mock_auth.d.ts +5 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +15 -6
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-77fcd73a.js → popup_redirect-e2867f33.js} +120 -64
- package/dist/cordova/popup_redirect-e2867f33.js.map +1 -0
- package/dist/cordova/src/api/index.d.ts +2 -1
- package/dist/cordova/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/cordova/src/core/util/handler.d.ts +1 -1
- package/dist/cordova/src/core/util/log.d.ts +1 -0
- package/dist/cordova/src/model/auth.d.ts +1 -0
- package/dist/cordova/test/helpers/mock_auth.d.ts +5 -0
- package/dist/esm2017/{index-c088f05c.js → index-5eca8e8e.js} +62 -26
- package/dist/esm2017/index-5eca8e8e.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/index.d.ts +2 -1
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/esm2017/src/core/util/handler.d.ts +1 -1
- package/dist/esm2017/src/core/util/log.d.ts +1 -0
- package/dist/esm2017/src/model/auth.d.ts +1 -0
- package/dist/esm2017/test/helpers/mock_auth.d.ts +5 -0
- package/dist/esm5/{index-7119ea16.js → index-ea49ccf6.js} +133 -68
- package/dist/esm5/index-ea49ccf6.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/index.d.ts +2 -1
- package/dist/esm5/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/esm5/src/core/util/handler.d.ts +1 -1
- package/dist/esm5/src/core/util/log.d.ts +1 -0
- package/dist/esm5/src/model/auth.d.ts +1 -0
- package/dist/esm5/test/helpers/mock_auth.d.ts +5 -0
- package/dist/index.webworker.esm5.js +59 -22
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/internal.js +61 -42
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/api/index.d.ts +2 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/node/src/core/util/handler.d.ts +1 -1
- package/dist/node/src/core/util/log.d.ts +1 -0
- package/dist/node/src/model/auth.d.ts +1 -0
- package/dist/node/test/helpers/mock_auth.d.ts +5 -0
- package/dist/node/{totp-220d9279.js → totp-e4b57fc2.js} +60 -23
- package/dist/node/totp-e4b57fc2.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/internal.js +16 -4
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/api/index.d.ts +2 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/node-esm/src/core/util/handler.d.ts +1 -1
- package/dist/node-esm/src/core/util/log.d.ts +1 -0
- package/dist/node-esm/src/model/auth.d.ts +1 -0
- package/dist/node-esm/test/helpers/mock_auth.d.ts +5 -0
- package/dist/node-esm/{totp-3a805e5d.js → totp-3a67b88c.js} +45 -22
- package/dist/node-esm/totp-3a67b88c.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +74 -46
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/{phone-a751cf13.js → phone-6ea1b9dd.js} +60 -23
- package/dist/rn/phone-6ea1b9dd.js.map +1 -0
- package/dist/rn/src/api/index.d.ts +2 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/rn/src/core/util/handler.d.ts +1 -1
- package/dist/rn/src/core/util/log.d.ts +1 -0
- package/dist/rn/src/model/auth.d.ts +1 -0
- package/dist/rn/test/helpers/mock_auth.d.ts +5 -0
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/core/auth/auth_impl.d.ts +4 -1
- package/dist/src/core/util/handler.d.ts +1 -1
- package/dist/src/core/util/log.d.ts +1 -0
- package/dist/src/model/auth.d.ts +1 -0
- package/dist/test/helpers/mock_auth.d.ts +5 -0
- package/package.json +6 -6
- package/dist/browser-cjs/index-845ba5cf.js.map +0 -1
- package/dist/cordova/popup_redirect-77fcd73a.js.map +0 -1
- package/dist/esm2017/index-c088f05c.js.map +0 -1
- package/dist/esm5/index-7119ea16.js.map +0 -1
- package/dist/node/totp-220d9279.js.map +0 -1
- package/dist/node-esm/totp-3a805e5d.js.map +0 -1
- package/dist/rn/phone-a751cf13.js.map +0 -1
package/dist/esm2017/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ActionCodeOperation, af as ActionCodeURL, I as AuthCredential, E as AuthErrorCodes, J as EmailAuthCredential, N as EmailAuthProvider, Q as FacebookAuthProvider, F as FactorId, V as GithubAuthProvider, U as GoogleAuthProvider, K as OAuthCredential, W as OAuthProvider, O as OperationType, L as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, X as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Y as TwitterAuthProvider, a4 as applyActionCode, v as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a5 as checkActionCode, a3 as confirmPasswordReset, H as connectAuthEmulator, a7 as createUserWithEmailAndPassword, C as debugErrorMap, B as deleteUser, ac as fetchSignInMethodsForEmail, an as getAdditionalUserInfo, o as getAuth, ak as getIdToken, al as getIdTokenResult, ap as getMultiFactorResolver, j as getRedirectResult, M as inMemoryPersistence, i as indexedDBLocalPersistence, G as initializeAuth, aa as isSignInWithEmailLink, $ as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, aq as multiFactor, w as onAuthStateChanged, t as onIdTokenChanged, ag as parseActionCodeURL, D as prodErrorMap, a0 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ao as reload, ad as sendEmailVerification, a2 as sendPasswordResetEmail, a9 as sendSignInLinkToEmail, q as setPersistence, Z as signInAnonymously, _ as signInWithCredential, a1 as signInWithCustomToken, a8 as signInWithEmailAndPassword, ab as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, z as signOut, am as unlink, y as updateCurrentUser, ai as updateEmail, aj as updatePassword, u as updatePhoneNumber, ah as updateProfile, x as useDeviceLanguage, ae as verifyBeforeUpdateEmail, a6 as verifyPasswordResetCode } from './index-
|
|
1
|
+
export { A as ActionCodeOperation, af as ActionCodeURL, I as AuthCredential, E as AuthErrorCodes, J as EmailAuthCredential, N as EmailAuthProvider, Q as FacebookAuthProvider, F as FactorId, V as GithubAuthProvider, U as GoogleAuthProvider, K as OAuthCredential, W as OAuthProvider, O as OperationType, L as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, X as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Y as TwitterAuthProvider, a4 as applyActionCode, v as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a5 as checkActionCode, a3 as confirmPasswordReset, H as connectAuthEmulator, a7 as createUserWithEmailAndPassword, C as debugErrorMap, B as deleteUser, ac as fetchSignInMethodsForEmail, an as getAdditionalUserInfo, o as getAuth, ak as getIdToken, al as getIdTokenResult, ap as getMultiFactorResolver, j as getRedirectResult, M as inMemoryPersistence, i as indexedDBLocalPersistence, G as initializeAuth, aa as isSignInWithEmailLink, $ as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, aq as multiFactor, w as onAuthStateChanged, t as onIdTokenChanged, ag as parseActionCodeURL, D as prodErrorMap, a0 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ao as reload, ad as sendEmailVerification, a2 as sendPasswordResetEmail, a9 as sendSignInLinkToEmail, q as setPersistence, Z as signInAnonymously, _ as signInWithCredential, a1 as signInWithCustomToken, a8 as signInWithEmailAndPassword, ab as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, z as signOut, am as unlink, y as updateCurrentUser, ai as updateEmail, aj as updatePassword, u as updatePhoneNumber, ah as updateProfile, x as useDeviceLanguage, ae as verifyBeforeUpdateEmail, a6 as verifyPasswordResetCode } from './index-5eca8e8e.js';
|
|
2
2
|
import '@firebase/util';
|
|
3
3
|
import '@firebase/app';
|
|
4
4
|
import '@firebase/logger';
|
package/dist/esm2017/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ar as debugAssert, as as _isIOS, at as _isAndroid, au as _fail, av as _getRedirectUrl, aw as _getProjectConfig, ax as _isIOS7Or8, ay as _createError, az as _assert, aA as AuthEventManager, aB as _getInstance, b as browserLocalPersistence, aC as _persistenceKeyName, a as browserSessionPersistence, aD as _getRedirectResult, aE as _overrideRedirectResult, aF as _clearRedirectOutcomes, aG as _castAuth } from './index-
|
|
2
|
-
export { A as ActionCodeOperation, af as ActionCodeURL, I as AuthCredential, E as AuthErrorCodes, aI as AuthImpl, aL as AuthPopup, J as EmailAuthCredential, N as EmailAuthProvider, Q as FacebookAuthProvider, F as FactorId, aM as FetchProvider, V as GithubAuthProvider, U as GoogleAuthProvider, K as OAuthCredential, W as OAuthProvider, O as OperationType, L as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aN as SAMLAuthCredential, X as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Y as TwitterAuthProvider, aH as UserImpl, az as _assert, aG as _castAuth, au as _fail, aK as _generateEventId, aJ as _getClientVersion, aB as _getInstance, aD as _getRedirectResult, aE as _overrideRedirectResult, aC as _persistenceKeyName, a4 as applyActionCode, v as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a5 as checkActionCode, a3 as confirmPasswordReset, H as connectAuthEmulator, a7 as createUserWithEmailAndPassword, C as debugErrorMap, B as deleteUser, ac as fetchSignInMethodsForEmail, an as getAdditionalUserInfo, o as getAuth, ak as getIdToken, al as getIdTokenResult, ap as getMultiFactorResolver, j as getRedirectResult, M as inMemoryPersistence, i as indexedDBLocalPersistence, G as initializeAuth, aa as isSignInWithEmailLink, $ as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, aq as multiFactor, w as onAuthStateChanged, t as onIdTokenChanged, ag as parseActionCodeURL, D as prodErrorMap, a0 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ao as reload, ad as sendEmailVerification, a2 as sendPasswordResetEmail, a9 as sendSignInLinkToEmail, q as setPersistence, Z as signInAnonymously, _ as signInWithCredential, a1 as signInWithCustomToken, a8 as signInWithEmailAndPassword, ab as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, z as signOut, am as unlink, y as updateCurrentUser, ai as updateEmail, aj as updatePassword, u as updatePhoneNumber, ah as updateProfile, x as useDeviceLanguage, ae as verifyBeforeUpdateEmail, a6 as verifyPasswordResetCode } from './index-
|
|
1
|
+
import { ar as debugAssert, as as _isIOS, at as _isAndroid, au as _fail, av as _getRedirectUrl, aw as _getProjectConfig, ax as _isIOS7Or8, ay as _createError, az as _assert, aA as AuthEventManager, aB as _getInstance, b as browserLocalPersistence, aC as _persistenceKeyName, a as browserSessionPersistence, aD as _getRedirectResult, aE as _overrideRedirectResult, aF as _clearRedirectOutcomes, aG as _castAuth } from './index-5eca8e8e.js';
|
|
2
|
+
export { A as ActionCodeOperation, af as ActionCodeURL, I as AuthCredential, E as AuthErrorCodes, aI as AuthImpl, aL as AuthPopup, J as EmailAuthCredential, N as EmailAuthProvider, Q as FacebookAuthProvider, F as FactorId, aM as FetchProvider, V as GithubAuthProvider, U as GoogleAuthProvider, K as OAuthCredential, W as OAuthProvider, O as OperationType, L as PhoneAuthCredential, P as PhoneAuthProvider, m as PhoneMultiFactorGenerator, p as ProviderId, R as RecaptchaVerifier, aN as SAMLAuthCredential, X as SAMLAuthProvider, S as SignInMethod, T as TotpMultiFactorGenerator, n as TotpSecret, Y as TwitterAuthProvider, aH as UserImpl, az as _assert, aG as _castAuth, au as _fail, aK as _generateEventId, aJ as _getClientVersion, aB as _getInstance, aD as _getRedirectResult, aE as _overrideRedirectResult, aC as _persistenceKeyName, a4 as applyActionCode, v as beforeAuthStateChanged, b as browserLocalPersistence, k as browserPopupRedirectResolver, a as browserSessionPersistence, a5 as checkActionCode, a3 as confirmPasswordReset, H as connectAuthEmulator, a7 as createUserWithEmailAndPassword, C as debugErrorMap, B as deleteUser, ac as fetchSignInMethodsForEmail, an as getAdditionalUserInfo, o as getAuth, ak as getIdToken, al as getIdTokenResult, ap as getMultiFactorResolver, j as getRedirectResult, M as inMemoryPersistence, i as indexedDBLocalPersistence, G as initializeAuth, aa as isSignInWithEmailLink, $ as linkWithCredential, l as linkWithPhoneNumber, d as linkWithPopup, g as linkWithRedirect, aq as multiFactor, w as onAuthStateChanged, t as onIdTokenChanged, ag as parseActionCodeURL, D as prodErrorMap, a0 as reauthenticateWithCredential, r as reauthenticateWithPhoneNumber, e as reauthenticateWithPopup, h as reauthenticateWithRedirect, ao as reload, ad as sendEmailVerification, a2 as sendPasswordResetEmail, a9 as sendSignInLinkToEmail, q as setPersistence, Z as signInAnonymously, _ as signInWithCredential, a1 as signInWithCustomToken, a8 as signInWithEmailAndPassword, ab as signInWithEmailLink, s as signInWithPhoneNumber, c as signInWithPopup, f as signInWithRedirect, z as signOut, am as unlink, y as updateCurrentUser, ai as updateEmail, aj as updatePassword, u as updatePhoneNumber, ah as updateProfile, x as useDeviceLanguage, ae as verifyBeforeUpdateEmail, a6 as verifyPasswordResetCode } from './index-5eca8e8e.js';
|
|
3
3
|
import { querystringDecode } from '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
|
5
5
|
import '@firebase/logger';
|
|
@@ -29,7 +29,8 @@ export declare const enum HttpHeader {
|
|
|
29
29
|
X_FIREBASE_LOCALE = "X-Firebase-Locale",
|
|
30
30
|
X_CLIENT_VERSION = "X-Client-Version",
|
|
31
31
|
X_FIREBASE_GMPID = "X-Firebase-gmpid",
|
|
32
|
-
X_FIREBASE_CLIENT = "X-Firebase-Client"
|
|
32
|
+
X_FIREBASE_CLIENT = "X-Firebase-Client",
|
|
33
|
+
X_FIREBASE_APP_CHECK = "X-Firebase-AppCheck"
|
|
33
34
|
}
|
|
34
35
|
export declare const enum Endpoint {
|
|
35
36
|
CREATE_AUTH_URI = "/v1/accounts:createAuthUri",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { _FirebaseService, FirebaseApp } from '@firebase/app';
|
|
18
18
|
import { Provider } from '@firebase/component';
|
|
19
|
+
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
|
|
19
20
|
import { Auth, AuthErrorMap, AuthSettings, EmulatorConfig, NextOrObserver, Persistence, PopupRedirectResolver, User, CompleteFn, ErrorFn, Unsubscribe } from '../../model/public_types';
|
|
20
21
|
import { ErrorFactory } from '@firebase/util';
|
|
21
22
|
import { AuthInternal, ConfigInternal } from '../../model/auth';
|
|
@@ -31,6 +32,7 @@ export declare const enum DefaultConfig {
|
|
|
31
32
|
export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
32
33
|
readonly app: FirebaseApp;
|
|
33
34
|
private readonly heartbeatServiceProvider;
|
|
35
|
+
private readonly appCheckServiceProvider;
|
|
34
36
|
readonly config: ConfigInternal;
|
|
35
37
|
currentUser: User | null;
|
|
36
38
|
emulatorConfig: EmulatorConfig | null;
|
|
@@ -53,7 +55,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
53
55
|
languageCode: string | null;
|
|
54
56
|
tenantId: string | null;
|
|
55
57
|
settings: AuthSettings;
|
|
56
|
-
constructor(app: FirebaseApp, heartbeatServiceProvider: Provider<'heartbeat'>, config: ConfigInternal);
|
|
58
|
+
constructor(app: FirebaseApp, heartbeatServiceProvider: Provider<'heartbeat'>, appCheckServiceProvider: Provider<AppCheckInternalComponentName>, config: ConfigInternal);
|
|
57
59
|
_initializeWithPersistence(persistenceHierarchy: PersistenceInternal[], popupRedirectResolver?: PopupRedirectResolver): Promise<void>;
|
|
58
60
|
/**
|
|
59
61
|
* If the persistence is changed in another window, the user manager will let us know
|
|
@@ -100,6 +102,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
100
102
|
_logFramework(framework: string): void;
|
|
101
103
|
_getFrameworks(): readonly string[];
|
|
102
104
|
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
105
|
+
_getAppCheckToken(): Promise<string | undefined>;
|
|
103
106
|
}
|
|
104
107
|
/**
|
|
105
108
|
* Method to be used to cast down to our private implmentation of Auth.
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
import { AuthProvider } from '../../model/public_types';
|
|
18
18
|
import { AuthInternal } from '../../model/auth';
|
|
19
19
|
import { AuthEventType } from '../../model/popup_redirect';
|
|
20
|
-
export declare function _getRedirectUrl(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, redirectUrl?: string, eventId?: string, additionalParams?: Record<string, string>): string
|
|
20
|
+
export declare function _getRedirectUrl(auth: AuthInternal, provider: AuthProvider, authType: AuthEventType, redirectUrl?: string, eventId?: string, additionalParams?: Record<string, string>): Promise<string>;
|
|
@@ -19,4 +19,5 @@ export { LogLevel };
|
|
|
19
19
|
export declare function _getLogLevel(): LogLevel;
|
|
20
20
|
export declare function _setLogLevel(newLevel: LogLevel): void;
|
|
21
21
|
export declare function _logDebug(msg: string, ...args: string[]): void;
|
|
22
|
+
export declare function _logWarn(msg: string, ...args: string[]): void;
|
|
22
23
|
export declare function _logError(msg: string, ...args: string[]): void;
|
|
@@ -64,6 +64,7 @@ export interface AuthInternal extends Auth {
|
|
|
64
64
|
_logFramework(framework: string): void;
|
|
65
65
|
_getFrameworks(): readonly string[];
|
|
66
66
|
_getAdditionalHeaders(): Promise<Record<string, string>>;
|
|
67
|
+
_getAppCheckToken(): Promise<string | undefined>;
|
|
67
68
|
readonly name: AppName;
|
|
68
69
|
readonly config: ConfigInternal;
|
|
69
70
|
languageCode: string | null;
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { Provider } from '@firebase/component';
|
|
18
|
+
import { AppCheckTokenResult } from '@firebase/app-check-interop-types';
|
|
18
19
|
import { PopupRedirectResolver } from '../../src/model/public_types';
|
|
19
20
|
import { AuthImpl } from '../../src/core/auth/auth_impl';
|
|
20
21
|
import { PersistedBlob } from '../../src/core/persistence';
|
|
@@ -33,6 +34,10 @@ export declare const FAKE_HEARTBEAT_CONTROLLER: {
|
|
|
33
34
|
getHeartbeatsHeader: () => Promise<string>;
|
|
34
35
|
};
|
|
35
36
|
export declare const FAKE_HEARTBEAT_CONTROLLER_PROVIDER: Provider<'heartbeat'>;
|
|
37
|
+
export declare const FAKE_APP_CHECK_CONTROLLER: {
|
|
38
|
+
getToken: () => Promise<AppCheckTokenResult>;
|
|
39
|
+
};
|
|
40
|
+
export declare const FAKE_APP_CHECK_CONTROLLER_PROVIDER: Provider<'app-check-internal'>;
|
|
36
41
|
export declare class MockPersistenceLayer extends InMemoryPersistence {
|
|
37
42
|
lastObjectSet: PersistedBlob | null;
|
|
38
43
|
_set(key: string, object: PersistedBlob): Promise<void>;
|
|
@@ -423,6 +423,15 @@ var AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {
|
|
|
423
423
|
* limitations under the License.
|
|
424
424
|
*/
|
|
425
425
|
var logClient = new Logger('@firebase/auth');
|
|
426
|
+
function _logWarn(msg) {
|
|
427
|
+
var args = [];
|
|
428
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
429
|
+
args[_i - 1] = arguments[_i];
|
|
430
|
+
}
|
|
431
|
+
if (logClient.logLevel <= LogLevel.WARN) {
|
|
432
|
+
logClient.warn.apply(logClient, __spreadArray(["Auth (".concat(SDK_VERSION, "): ").concat(msg)], args, false));
|
|
433
|
+
}
|
|
434
|
+
}
|
|
426
435
|
function _logError(msg) {
|
|
427
436
|
var args = [];
|
|
428
437
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -2596,9 +2605,10 @@ var AuthMiddlewareQueue = /** @class */ (function () {
|
|
|
2596
2605
|
* limitations under the License.
|
|
2597
2606
|
*/
|
|
2598
2607
|
var AuthImpl = /** @class */ (function () {
|
|
2599
|
-
function AuthImpl(app, heartbeatServiceProvider, config) {
|
|
2608
|
+
function AuthImpl(app, heartbeatServiceProvider, appCheckServiceProvider, config) {
|
|
2600
2609
|
this.app = app;
|
|
2601
2610
|
this.heartbeatServiceProvider = heartbeatServiceProvider;
|
|
2611
|
+
this.appCheckServiceProvider = appCheckServiceProvider;
|
|
2602
2612
|
this.config = config;
|
|
2603
2613
|
this.currentUser = null;
|
|
2604
2614
|
this.emulatorConfig = null;
|
|
@@ -3172,7 +3182,7 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3172
3182
|
AuthImpl.prototype._getAdditionalHeaders = function () {
|
|
3173
3183
|
var _a;
|
|
3174
3184
|
return __awaiter(this, void 0, void 0, function () {
|
|
3175
|
-
var headers, heartbeatsHeader;
|
|
3185
|
+
var headers, heartbeatsHeader, appCheckToken;
|
|
3176
3186
|
var _b;
|
|
3177
3187
|
return __generator(this, function (_c) {
|
|
3178
3188
|
switch (_c.label) {
|
|
@@ -3192,11 +3202,39 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3192
3202
|
if (heartbeatsHeader) {
|
|
3193
3203
|
headers["X-Firebase-Client" /* HttpHeader.X_FIREBASE_CLIENT */] = heartbeatsHeader;
|
|
3194
3204
|
}
|
|
3205
|
+
return [4 /*yield*/, this._getAppCheckToken()];
|
|
3206
|
+
case 2:
|
|
3207
|
+
appCheckToken = _c.sent();
|
|
3208
|
+
if (appCheckToken) {
|
|
3209
|
+
headers["X-Firebase-AppCheck" /* HttpHeader.X_FIREBASE_APP_CHECK */] = appCheckToken;
|
|
3210
|
+
}
|
|
3195
3211
|
return [2 /*return*/, headers];
|
|
3196
3212
|
}
|
|
3197
3213
|
});
|
|
3198
3214
|
});
|
|
3199
3215
|
};
|
|
3216
|
+
AuthImpl.prototype._getAppCheckToken = function () {
|
|
3217
|
+
var _a;
|
|
3218
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3219
|
+
var appCheckTokenResult;
|
|
3220
|
+
return __generator(this, function (_b) {
|
|
3221
|
+
switch (_b.label) {
|
|
3222
|
+
case 0: return [4 /*yield*/, ((_a = this.appCheckServiceProvider
|
|
3223
|
+
.getImmediate({ optional: true })) === null || _a === void 0 ? void 0 : _a.getToken())];
|
|
3224
|
+
case 1:
|
|
3225
|
+
appCheckTokenResult = _b.sent();
|
|
3226
|
+
if (appCheckTokenResult === null || appCheckTokenResult === void 0 ? void 0 : appCheckTokenResult.error) {
|
|
3227
|
+
// Context: appCheck.getToken() will never throw even if an error happened.
|
|
3228
|
+
// In the error case, a dummy token will be returned along with an error field describing
|
|
3229
|
+
// the error. In general, we shouldn't care about the error condition and just use
|
|
3230
|
+
// the token (actual or dummy) to send requests.
|
|
3231
|
+
_logWarn("Error while retrieving App Check token: ".concat(appCheckTokenResult.error));
|
|
3232
|
+
}
|
|
3233
|
+
return [2 /*return*/, appCheckTokenResult === null || appCheckTokenResult === void 0 ? void 0 : appCheckTokenResult.token];
|
|
3234
|
+
}
|
|
3235
|
+
});
|
|
3236
|
+
});
|
|
3237
|
+
};
|
|
3200
3238
|
return AuthImpl;
|
|
3201
3239
|
}());
|
|
3202
3240
|
/**
|
|
@@ -10867,48 +10905,67 @@ var WIDGET_PATH = '__/auth/handler';
|
|
|
10867
10905
|
* @internal
|
|
10868
10906
|
*/
|
|
10869
10907
|
var EMULATOR_WIDGET_PATH = 'emulator/auth/handler';
|
|
10908
|
+
/**
|
|
10909
|
+
* Fragment name for the App Check token that gets passed to the widget
|
|
10910
|
+
*
|
|
10911
|
+
* @internal
|
|
10912
|
+
*/
|
|
10913
|
+
var FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac');
|
|
10870
10914
|
function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10874
|
-
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10881
|
-
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10889
|
-
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10896
|
-
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10915
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10916
|
+
var params, _i, _a, _b, key, value, scopes, paramsDict, _c, _d, key, appCheckToken, appCheckTokenFragment;
|
|
10917
|
+
return __generator(this, function (_e) {
|
|
10918
|
+
switch (_e.label) {
|
|
10919
|
+
case 0:
|
|
10920
|
+
_assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
|
|
10921
|
+
_assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */);
|
|
10922
|
+
params = {
|
|
10923
|
+
apiKey: auth.config.apiKey,
|
|
10924
|
+
appName: auth.name,
|
|
10925
|
+
authType: authType,
|
|
10926
|
+
redirectUrl: redirectUrl,
|
|
10927
|
+
v: SDK_VERSION,
|
|
10928
|
+
eventId: eventId
|
|
10929
|
+
};
|
|
10930
|
+
if (provider instanceof FederatedAuthProvider) {
|
|
10931
|
+
provider.setDefaultLanguage(auth.languageCode);
|
|
10932
|
+
params.providerId = provider.providerId || '';
|
|
10933
|
+
if (!isEmpty(provider.getCustomParameters())) {
|
|
10934
|
+
params.customParameters = JSON.stringify(provider.getCustomParameters());
|
|
10935
|
+
}
|
|
10936
|
+
// TODO set additionalParams from the provider as well?
|
|
10937
|
+
for (_i = 0, _a = Object.entries(additionalParams || {}); _i < _a.length; _i++) {
|
|
10938
|
+
_b = _a[_i], key = _b[0], value = _b[1];
|
|
10939
|
+
params[key] = value;
|
|
10940
|
+
}
|
|
10941
|
+
}
|
|
10942
|
+
if (provider instanceof BaseOAuthProvider) {
|
|
10943
|
+
scopes = provider.getScopes().filter(function (scope) { return scope !== ''; });
|
|
10944
|
+
if (scopes.length > 0) {
|
|
10945
|
+
params.scopes = scopes.join(',');
|
|
10946
|
+
}
|
|
10947
|
+
}
|
|
10948
|
+
if (auth.tenantId) {
|
|
10949
|
+
params.tid = auth.tenantId;
|
|
10950
|
+
}
|
|
10951
|
+
paramsDict = params;
|
|
10952
|
+
for (_c = 0, _d = Object.keys(paramsDict); _c < _d.length; _c++) {
|
|
10953
|
+
key = _d[_c];
|
|
10954
|
+
if (paramsDict[key] === undefined) {
|
|
10955
|
+
delete paramsDict[key];
|
|
10956
|
+
}
|
|
10957
|
+
}
|
|
10958
|
+
return [4 /*yield*/, auth._getAppCheckToken()];
|
|
10959
|
+
case 1:
|
|
10960
|
+
appCheckToken = _e.sent();
|
|
10961
|
+
appCheckTokenFragment = appCheckToken
|
|
10962
|
+
? "#".concat(FIREBASE_APP_CHECK_FRAGMENT_ID, "=").concat(encodeURIComponent(appCheckToken))
|
|
10963
|
+
: '';
|
|
10964
|
+
// Start at index 1 to skip the leading '&' in the query string
|
|
10965
|
+
return [2 /*return*/, "".concat(getHandlerBase(auth), "?").concat(querystring(paramsDict).slice(1)).concat(appCheckTokenFragment)];
|
|
10966
|
+
}
|
|
10967
|
+
});
|
|
10968
|
+
});
|
|
10912
10969
|
}
|
|
10913
10970
|
function getHandlerBase(_a) {
|
|
10914
10971
|
var config = _a.config;
|
|
@@ -10955,20 +11012,29 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
10955
11012
|
return __awaiter(this, void 0, void 0, function () {
|
|
10956
11013
|
var url;
|
|
10957
11014
|
return __generator(this, function (_b) {
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
11015
|
+
switch (_b.label) {
|
|
11016
|
+
case 0:
|
|
11017
|
+
debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
|
|
11018
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId)];
|
|
11019
|
+
case 1:
|
|
11020
|
+
url = _b.sent();
|
|
11021
|
+
return [2 /*return*/, _open(auth, url, _generateEventId())];
|
|
11022
|
+
}
|
|
10961
11023
|
});
|
|
10962
11024
|
});
|
|
10963
11025
|
};
|
|
10964
11026
|
BrowserPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
|
|
10965
11027
|
return __awaiter(this, void 0, void 0, function () {
|
|
11028
|
+
var url;
|
|
10966
11029
|
return __generator(this, function (_a) {
|
|
10967
11030
|
switch (_a.label) {
|
|
10968
11031
|
case 0: return [4 /*yield*/, this._originValidation(auth)];
|
|
10969
11032
|
case 1:
|
|
10970
11033
|
_a.sent();
|
|
10971
|
-
|
|
11034
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, _getCurrentUrl(), eventId)];
|
|
11035
|
+
case 2:
|
|
11036
|
+
url = _a.sent();
|
|
11037
|
+
_setWindowLocation(url);
|
|
10972
11038
|
return [2 /*return*/, new Promise(function () { })];
|
|
10973
11039
|
}
|
|
10974
11040
|
});
|
|
@@ -11303,7 +11369,7 @@ function _isEmptyString(input) {
|
|
|
11303
11369
|
}
|
|
11304
11370
|
|
|
11305
11371
|
var name = "@firebase/auth";
|
|
11306
|
-
var version = "0.22.0-canary.
|
|
11372
|
+
var version = "0.22.0-canary.ea3849fff";
|
|
11307
11373
|
|
|
11308
11374
|
/**
|
|
11309
11375
|
* @license
|
|
@@ -11423,26 +11489,25 @@ function registerAuth(clientPlatform) {
|
|
|
11423
11489
|
var deps = _a.options;
|
|
11424
11490
|
var app = container.getProvider('app').getImmediate();
|
|
11425
11491
|
var heartbeatServiceProvider = container.getProvider('heartbeat');
|
|
11492
|
+
var appCheckServiceProvider = container.getProvider('app-check-internal');
|
|
11426
11493
|
var _b = app.options, apiKey = _b.apiKey, authDomain = _b.authDomain;
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11441
|
-
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
return authInstance;
|
|
11445
|
-
})(app, heartbeatServiceProvider);
|
|
11494
|
+
_assert(apiKey && !apiKey.includes(':'), "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */, { appName: app.name });
|
|
11495
|
+
// Auth domain is optional if IdP sign in isn't being used
|
|
11496
|
+
_assert(!(authDomain === null || authDomain === void 0 ? void 0 : authDomain.includes(':')), "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */, {
|
|
11497
|
+
appName: app.name
|
|
11498
|
+
});
|
|
11499
|
+
var config = {
|
|
11500
|
+
apiKey: apiKey,
|
|
11501
|
+
authDomain: authDomain,
|
|
11502
|
+
clientPlatform: clientPlatform,
|
|
11503
|
+
apiHost: "identitytoolkit.googleapis.com" /* DefaultConfig.API_HOST */,
|
|
11504
|
+
tokenApiHost: "securetoken.googleapis.com" /* DefaultConfig.TOKEN_API_HOST */,
|
|
11505
|
+
apiScheme: "https" /* DefaultConfig.API_SCHEME */,
|
|
11506
|
+
sdkClientVersion: _getClientVersion(clientPlatform)
|
|
11507
|
+
};
|
|
11508
|
+
var authInstance = new AuthImpl(app, heartbeatServiceProvider, appCheckServiceProvider, config);
|
|
11509
|
+
_initializeAuthInstance(authInstance, deps);
|
|
11510
|
+
return authInstance;
|
|
11446
11511
|
}, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
11447
11512
|
/**
|
|
11448
11513
|
* Auth can only be initialized by explicitly calling getAuth() or initializeAuth()
|
|
@@ -11561,4 +11626,4 @@ function getAuth(app) {
|
|
|
11561
11626
|
registerAuth("Browser" /* ClientPlatform.BROWSER */);
|
|
11562
11627
|
|
|
11563
11628
|
export { linkWithCredential as $, ActionCodeOperation as A, deleteUser as B, debugErrorMap as C, prodErrorMap as D, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY as E, FactorId as F, initializeAuth as G, connectAuthEmulator as H, AuthCredential as I, EmailAuthCredential as J, OAuthCredential as K, PhoneAuthCredential as L, inMemoryPersistence as M, EmailAuthProvider as N, OperationType as O, PhoneAuthProvider as P, FacebookAuthProvider as Q, RecaptchaVerifier as R, SignInMethod as S, TotpMultiFactorGenerator as T, GoogleAuthProvider as U, GithubAuthProvider as V, OAuthProvider as W, SAMLAuthProvider as X, TwitterAuthProvider as Y, signInAnonymously as Z, signInWithCredential as _, browserSessionPersistence as a, reauthenticateWithCredential as a0, signInWithCustomToken as a1, sendPasswordResetEmail as a2, confirmPasswordReset as a3, applyActionCode as a4, checkActionCode as a5, verifyPasswordResetCode as a6, createUserWithEmailAndPassword as a7, signInWithEmailAndPassword as a8, sendSignInLinkToEmail as a9, AuthEventManager as aA, _getInstance as aB, _persistenceKeyName as aC, _clearRedirectOutcomes as aD, _getRedirectResult as aE, _overrideRedirectResult as aF, _castAuth as aG, UserImpl as aH, AuthImpl as aI, _getClientVersion as aJ, _generateEventId as aK, AuthPopup as aL, FetchProvider as aM, SAMLAuthCredential as aN, isSignInWithEmailLink as aa, signInWithEmailLink as ab, fetchSignInMethodsForEmail as ac, sendEmailVerification as ad, verifyBeforeUpdateEmail as ae, ActionCodeURL as af, parseActionCodeURL as ag, updateProfile as ah, updateEmail as ai, updatePassword as aj, getIdToken as ak, getIdTokenResult as al, unlink as am, getAdditionalUserInfo as an, reload as ao, getMultiFactorResolver as ap, multiFactor as aq, _isIOS as ar, _isAndroid as as, _fail as at, _getRedirectUrl as au, debugAssert as av, _getProjectConfig as aw, _isIOS7Or8 as ax, _assert as ay, _createError as az, browserLocalPersistence as b, signInWithPopup as c, linkWithPopup as d, reauthenticateWithPopup as e, signInWithRedirect as f, linkWithRedirect as g, reauthenticateWithRedirect as h, indexedDBLocalPersistence as i, getRedirectResult as j, browserPopupRedirectResolver as k, linkWithPhoneNumber as l, PhoneMultiFactorGenerator as m, TotpSecret as n, getAuth as o, ProviderId as p, setPersistence as q, reauthenticateWithPhoneNumber as r, signInWithPhoneNumber as s, onIdTokenChanged as t, updatePhoneNumber as u, beforeAuthStateChanged as v, onAuthStateChanged as w, useDeviceLanguage as x, updateCurrentUser as y, signOut as z };
|
|
11564
|
-
//# sourceMappingURL=index-
|
|
11629
|
+
//# sourceMappingURL=index-ea49ccf6.js.map
|