@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/esm5/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-ea49ccf6.js';
|
|
2
2
|
import 'tslib';
|
|
3
3
|
import '@firebase/util';
|
|
4
4
|
import '@firebase/app';
|
package/dist/esm5/internal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ar as _isIOS, as as _isAndroid, at as _fail, au as _getRedirectUrl, av as debugAssert, aw as _getProjectConfig, ax as _isIOS7Or8, ay as _assert, az as _createError, aA as AuthEventManager, aB as _getInstance, b as browserLocalPersistence, aC as _persistenceKeyName, aD as _clearRedirectOutcomes, a as browserSessionPersistence, aE as _getRedirectResult, aF as _overrideRedirectResult, 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, ay as _assert, aG as _castAuth, at as _fail, aK as _generateEventId, aJ as _getClientVersion, aB as _getInstance, aE as _getRedirectResult, aF 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 _isIOS, as as _isAndroid, at as _fail, au as _getRedirectUrl, av as debugAssert, aw as _getProjectConfig, ax as _isIOS7Or8, ay as _assert, az as _createError, aA as AuthEventManager, aB as _getInstance, b as browserLocalPersistence, aC as _persistenceKeyName, aD as _clearRedirectOutcomes, a as browserSessionPersistence, aE as _getRedirectResult, aF as _overrideRedirectResult, aG as _castAuth } from './index-ea49ccf6.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, ay as _assert, aG as _castAuth, at as _fail, aK as _generateEventId, aJ as _getClientVersion, aB as _getInstance, aE as _getRedirectResult, aF 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-ea49ccf6.js';
|
|
3
3
|
import { __awaiter, __generator, __extends } from 'tslib';
|
|
4
4
|
import { querystringDecode } from '@firebase/util';
|
|
5
5
|
import '@firebase/app';
|
|
@@ -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>;
|
|
@@ -324,6 +324,15 @@ var AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {
|
|
|
324
324
|
* limitations under the License.
|
|
325
325
|
*/
|
|
326
326
|
var logClient = new Logger('@firebase/auth');
|
|
327
|
+
function _logWarn(msg) {
|
|
328
|
+
var args = [];
|
|
329
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
330
|
+
args[_i - 1] = arguments[_i];
|
|
331
|
+
}
|
|
332
|
+
if (logClient.logLevel <= LogLevel.WARN) {
|
|
333
|
+
logClient.warn.apply(logClient, __spreadArray(["Auth (".concat(SDK_VERSION, "): ").concat(msg)], args, false));
|
|
334
|
+
}
|
|
335
|
+
}
|
|
327
336
|
function _logError(msg) {
|
|
328
337
|
var args = [];
|
|
329
338
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -524,7 +533,7 @@ function _initializeAuthInstance(auth, deps) {
|
|
|
524
533
|
}
|
|
525
534
|
|
|
526
535
|
var name = "@firebase/auth";
|
|
527
|
-
var version = "0.22.0-canary.
|
|
536
|
+
var version = "0.22.0-canary.ea3849fff";
|
|
528
537
|
|
|
529
538
|
/**
|
|
530
539
|
* @license
|
|
@@ -2452,9 +2461,10 @@ var AuthMiddlewareQueue = /** @class */ (function () {
|
|
|
2452
2461
|
* limitations under the License.
|
|
2453
2462
|
*/
|
|
2454
2463
|
var AuthImpl = /** @class */ (function () {
|
|
2455
|
-
function AuthImpl(app, heartbeatServiceProvider, config) {
|
|
2464
|
+
function AuthImpl(app, heartbeatServiceProvider, appCheckServiceProvider, config) {
|
|
2456
2465
|
this.app = app;
|
|
2457
2466
|
this.heartbeatServiceProvider = heartbeatServiceProvider;
|
|
2467
|
+
this.appCheckServiceProvider = appCheckServiceProvider;
|
|
2458
2468
|
this.config = config;
|
|
2459
2469
|
this.currentUser = null;
|
|
2460
2470
|
this.emulatorConfig = null;
|
|
@@ -3028,7 +3038,7 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3028
3038
|
AuthImpl.prototype._getAdditionalHeaders = function () {
|
|
3029
3039
|
var _a;
|
|
3030
3040
|
return __awaiter(this, void 0, void 0, function () {
|
|
3031
|
-
var headers, heartbeatsHeader;
|
|
3041
|
+
var headers, heartbeatsHeader, appCheckToken;
|
|
3032
3042
|
var _b;
|
|
3033
3043
|
return __generator(this, function (_c) {
|
|
3034
3044
|
switch (_c.label) {
|
|
@@ -3048,11 +3058,39 @@ var AuthImpl = /** @class */ (function () {
|
|
|
3048
3058
|
if (heartbeatsHeader) {
|
|
3049
3059
|
headers["X-Firebase-Client" /* HttpHeader.X_FIREBASE_CLIENT */] = heartbeatsHeader;
|
|
3050
3060
|
}
|
|
3061
|
+
return [4 /*yield*/, this._getAppCheckToken()];
|
|
3062
|
+
case 2:
|
|
3063
|
+
appCheckToken = _c.sent();
|
|
3064
|
+
if (appCheckToken) {
|
|
3065
|
+
headers["X-Firebase-AppCheck" /* HttpHeader.X_FIREBASE_APP_CHECK */] = appCheckToken;
|
|
3066
|
+
}
|
|
3051
3067
|
return [2 /*return*/, headers];
|
|
3052
3068
|
}
|
|
3053
3069
|
});
|
|
3054
3070
|
});
|
|
3055
3071
|
};
|
|
3072
|
+
AuthImpl.prototype._getAppCheckToken = function () {
|
|
3073
|
+
var _a;
|
|
3074
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
3075
|
+
var appCheckTokenResult;
|
|
3076
|
+
return __generator(this, function (_b) {
|
|
3077
|
+
switch (_b.label) {
|
|
3078
|
+
case 0: return [4 /*yield*/, ((_a = this.appCheckServiceProvider
|
|
3079
|
+
.getImmediate({ optional: true })) === null || _a === void 0 ? void 0 : _a.getToken())];
|
|
3080
|
+
case 1:
|
|
3081
|
+
appCheckTokenResult = _b.sent();
|
|
3082
|
+
if (appCheckTokenResult === null || appCheckTokenResult === void 0 ? void 0 : appCheckTokenResult.error) {
|
|
3083
|
+
// Context: appCheck.getToken() will never throw even if an error happened.
|
|
3084
|
+
// In the error case, a dummy token will be returned along with an error field describing
|
|
3085
|
+
// the error. In general, we shouldn't care about the error condition and just use
|
|
3086
|
+
// the token (actual or dummy) to send requests.
|
|
3087
|
+
_logWarn("Error while retrieving App Check token: ".concat(appCheckTokenResult.error));
|
|
3088
|
+
}
|
|
3089
|
+
return [2 /*return*/, appCheckTokenResult === null || appCheckTokenResult === void 0 ? void 0 : appCheckTokenResult.token];
|
|
3090
|
+
}
|
|
3091
|
+
});
|
|
3092
|
+
});
|
|
3093
|
+
};
|
|
3056
3094
|
return AuthImpl;
|
|
3057
3095
|
}());
|
|
3058
3096
|
/**
|
|
@@ -3201,26 +3239,25 @@ function registerAuth(clientPlatform) {
|
|
|
3201
3239
|
var deps = _a.options;
|
|
3202
3240
|
var app = container.getProvider('app').getImmediate();
|
|
3203
3241
|
var heartbeatServiceProvider = container.getProvider('heartbeat');
|
|
3242
|
+
var appCheckServiceProvider = container.getProvider('app-check-internal');
|
|
3204
3243
|
var _b = app.options, apiKey = _b.apiKey, authDomain = _b.authDomain;
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
return authInstance;
|
|
3223
|
-
})(app, heartbeatServiceProvider);
|
|
3244
|
+
_assert(apiKey && !apiKey.includes(':'), "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */, { appName: app.name });
|
|
3245
|
+
// Auth domain is optional if IdP sign in isn't being used
|
|
3246
|
+
_assert(!(authDomain === null || authDomain === void 0 ? void 0 : authDomain.includes(':')), "argument-error" /* AuthErrorCode.ARGUMENT_ERROR */, {
|
|
3247
|
+
appName: app.name
|
|
3248
|
+
});
|
|
3249
|
+
var config = {
|
|
3250
|
+
apiKey: apiKey,
|
|
3251
|
+
authDomain: authDomain,
|
|
3252
|
+
clientPlatform: clientPlatform,
|
|
3253
|
+
apiHost: "identitytoolkit.googleapis.com" /* DefaultConfig.API_HOST */,
|
|
3254
|
+
tokenApiHost: "securetoken.googleapis.com" /* DefaultConfig.TOKEN_API_HOST */,
|
|
3255
|
+
apiScheme: "https" /* DefaultConfig.API_SCHEME */,
|
|
3256
|
+
sdkClientVersion: _getClientVersion(clientPlatform)
|
|
3257
|
+
};
|
|
3258
|
+
var authInstance = new AuthImpl(app, heartbeatServiceProvider, appCheckServiceProvider, config);
|
|
3259
|
+
_initializeAuthInstance(authInstance, deps);
|
|
3260
|
+
return authInstance;
|
|
3224
3261
|
}, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
3225
3262
|
/**
|
|
3226
3263
|
* Auth can only be initialized by explicitly calling getAuth() or initializeAuth()
|