@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/rn/index.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var ReactNative = require('react-native');
|
|
6
6
|
var app = require('@firebase/app');
|
|
7
|
-
var phone = require('./phone-
|
|
7
|
+
var phone = require('./phone-6ea1b9dd.js');
|
|
8
8
|
var tslib = require('tslib');
|
|
9
9
|
require('@firebase/util');
|
|
10
10
|
require('@firebase/component');
|
package/dist/rn/internal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var phone = require('./phone-
|
|
5
|
+
var phone = require('./phone-6ea1b9dd.js');
|
|
6
6
|
var tslib = require('tslib');
|
|
7
7
|
var util = require('@firebase/util');
|
|
8
8
|
var app = require('@firebase/app');
|
|
@@ -2698,48 +2698,67 @@ var WIDGET_PATH = '__/auth/handler';
|
|
|
2698
2698
|
* @internal
|
|
2699
2699
|
*/
|
|
2700
2700
|
var EMULATOR_WIDGET_PATH = 'emulator/auth/handler';
|
|
2701
|
+
/**
|
|
2702
|
+
* Fragment name for the App Check token that gets passed to the widget
|
|
2703
|
+
*
|
|
2704
|
+
* @internal
|
|
2705
|
+
*/
|
|
2706
|
+
var FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac');
|
|
2701
2707
|
function _getRedirectUrl(auth, provider, authType, redirectUrl, eventId, additionalParams) {
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2708
|
+
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2709
|
+
var params, _i, _a, _b, key, value, scopes, paramsDict, _c, _d, key, appCheckToken, appCheckTokenFragment;
|
|
2710
|
+
return tslib.__generator(this, function (_e) {
|
|
2711
|
+
switch (_e.label) {
|
|
2712
|
+
case 0:
|
|
2713
|
+
phone._assert(auth.config.authDomain, auth, "auth-domain-config-required" /* AuthErrorCode.MISSING_AUTH_DOMAIN */);
|
|
2714
|
+
phone._assert(auth.config.apiKey, auth, "invalid-api-key" /* AuthErrorCode.INVALID_API_KEY */);
|
|
2715
|
+
params = {
|
|
2716
|
+
apiKey: auth.config.apiKey,
|
|
2717
|
+
appName: auth.name,
|
|
2718
|
+
authType: authType,
|
|
2719
|
+
redirectUrl: redirectUrl,
|
|
2720
|
+
v: app.SDK_VERSION,
|
|
2721
|
+
eventId: eventId
|
|
2722
|
+
};
|
|
2723
|
+
if (provider instanceof phone.FederatedAuthProvider) {
|
|
2724
|
+
provider.setDefaultLanguage(auth.languageCode);
|
|
2725
|
+
params.providerId = provider.providerId || '';
|
|
2726
|
+
if (!util.isEmpty(provider.getCustomParameters())) {
|
|
2727
|
+
params.customParameters = JSON.stringify(provider.getCustomParameters());
|
|
2728
|
+
}
|
|
2729
|
+
// TODO set additionalParams from the provider as well?
|
|
2730
|
+
for (_i = 0, _a = Object.entries(additionalParams || {}); _i < _a.length; _i++) {
|
|
2731
|
+
_b = _a[_i], key = _b[0], value = _b[1];
|
|
2732
|
+
params[key] = value;
|
|
2733
|
+
}
|
|
2734
|
+
}
|
|
2735
|
+
if (provider instanceof phone.BaseOAuthProvider) {
|
|
2736
|
+
scopes = provider.getScopes().filter(function (scope) { return scope !== ''; });
|
|
2737
|
+
if (scopes.length > 0) {
|
|
2738
|
+
params.scopes = scopes.join(',');
|
|
2739
|
+
}
|
|
2740
|
+
}
|
|
2741
|
+
if (auth.tenantId) {
|
|
2742
|
+
params.tid = auth.tenantId;
|
|
2743
|
+
}
|
|
2744
|
+
paramsDict = params;
|
|
2745
|
+
for (_c = 0, _d = Object.keys(paramsDict); _c < _d.length; _c++) {
|
|
2746
|
+
key = _d[_c];
|
|
2747
|
+
if (paramsDict[key] === undefined) {
|
|
2748
|
+
delete paramsDict[key];
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
return [4 /*yield*/, auth._getAppCheckToken()];
|
|
2752
|
+
case 1:
|
|
2753
|
+
appCheckToken = _e.sent();
|
|
2754
|
+
appCheckTokenFragment = appCheckToken
|
|
2755
|
+
? "#".concat(FIREBASE_APP_CHECK_FRAGMENT_ID, "=").concat(encodeURIComponent(appCheckToken))
|
|
2756
|
+
: '';
|
|
2757
|
+
// Start at index 1 to skip the leading '&' in the query string
|
|
2758
|
+
return [2 /*return*/, "".concat(getHandlerBase(auth), "?").concat(util.querystring(paramsDict).slice(1)).concat(appCheckTokenFragment)];
|
|
2759
|
+
}
|
|
2760
|
+
});
|
|
2761
|
+
});
|
|
2743
2762
|
}
|
|
2744
2763
|
function getHandlerBase(_a) {
|
|
2745
2764
|
var config = _a.config;
|
|
@@ -2786,20 +2805,29 @@ var BrowserPopupRedirectResolver = /** @class */ (function () {
|
|
|
2786
2805
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2787
2806
|
var url;
|
|
2788
2807
|
return tslib.__generator(this, function (_b) {
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2808
|
+
switch (_b.label) {
|
|
2809
|
+
case 0:
|
|
2810
|
+
phone.debugAssert((_a = this.eventManagers[auth._key()]) === null || _a === void 0 ? void 0 : _a.manager, '_initialize() not called before _openPopup()');
|
|
2811
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId)];
|
|
2812
|
+
case 1:
|
|
2813
|
+
url = _b.sent();
|
|
2814
|
+
return [2 /*return*/, _open(auth, url, _generateEventId())];
|
|
2815
|
+
}
|
|
2792
2816
|
});
|
|
2793
2817
|
});
|
|
2794
2818
|
};
|
|
2795
2819
|
BrowserPopupRedirectResolver.prototype._openRedirect = function (auth, provider, authType, eventId) {
|
|
2796
2820
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
2821
|
+
var url;
|
|
2797
2822
|
return tslib.__generator(this, function (_a) {
|
|
2798
2823
|
switch (_a.label) {
|
|
2799
2824
|
case 0: return [4 /*yield*/, this._originValidation(auth)];
|
|
2800
2825
|
case 1:
|
|
2801
2826
|
_a.sent();
|
|
2802
|
-
|
|
2827
|
+
return [4 /*yield*/, _getRedirectUrl(auth, provider, authType, phone._getCurrentUrl(), eventId)];
|
|
2828
|
+
case 2:
|
|
2829
|
+
url = _a.sent();
|
|
2830
|
+
phone._setWindowLocation(url);
|
|
2803
2831
|
return [2 /*return*/, new Promise(function () { })];
|
|
2804
2832
|
}
|
|
2805
2833
|
});
|