@firebase/auth 1.6.2 → 1.7.0-canary.42fcdfe4c
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-public.d.ts +60 -10
- package/dist/auth.d.ts +61 -10
- package/dist/browser-cjs/{index-6a907fc6.js → index-fcf80d66.js} +202 -22
- package/dist/browser-cjs/index-fcf80d66.js.map +1 -0
- package/dist/browser-cjs/index.js +2 -2
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/browser-cjs/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/browser-cjs/src/core/index.d.ts +9 -1
- package/dist/browser-cjs/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/browser-cjs/src/core/strategies/credential.d.ts +6 -0
- package/dist/browser-cjs/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/browser-cjs/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/browser-cjs/src/core/strategies/email_link.d.ts +4 -0
- package/dist/browser-cjs/src/core/user/account_info.d.ts +3 -0
- package/dist/browser-cjs/src/core/user/reload.d.ts +3 -1
- package/dist/browser-cjs/src/core/user/token_manager.d.ts +1 -0
- package/dist/browser-cjs/src/core/user/user_impl.d.ts +7 -1
- package/dist/browser-cjs/src/core/util/assert.d.ts +1 -0
- package/dist/browser-cjs/src/model/public_types.d.ts +7 -0
- package/dist/browser-cjs/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/browser-cjs/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/browser-cjs/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/browser-cjs/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/browser-cjs/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/internal.js +45 -17
- package/dist/cordova/internal.js.map +1 -1
- package/dist/cordova/{popup_redirect-58faecee.js → popup_redirect-65e04583.js} +197 -17
- package/dist/cordova/popup_redirect-65e04583.js.map +1 -0
- package/dist/cordova/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/cordova/src/core/index.d.ts +9 -1
- package/dist/cordova/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/cordova/src/core/strategies/credential.d.ts +6 -0
- package/dist/cordova/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/cordova/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/cordova/src/core/strategies/email_link.d.ts +4 -0
- package/dist/cordova/src/core/user/account_info.d.ts +3 -0
- package/dist/cordova/src/core/user/reload.d.ts +3 -1
- package/dist/cordova/src/core/user/token_manager.d.ts +1 -0
- package/dist/cordova/src/core/user/user_impl.d.ts +7 -1
- package/dist/cordova/src/core/util/assert.d.ts +1 -0
- package/dist/cordova/src/model/public_types.d.ts +7 -0
- package/dist/cordova/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/cordova/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/cordova/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/cordova/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/cordova/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/esm2017/{index-e939beb5.js → index-3ad9a9b9.js} +202 -22
- package/dist/esm2017/index-3ad9a9b9.js.map +1 -0
- package/dist/esm2017/index.js +2 -2
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/esm2017/src/core/index.d.ts +9 -1
- package/dist/esm2017/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/esm2017/src/core/strategies/credential.d.ts +6 -0
- package/dist/esm2017/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/esm2017/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/esm2017/src/core/strategies/email_link.d.ts +4 -0
- package/dist/esm2017/src/core/user/account_info.d.ts +3 -0
- package/dist/esm2017/src/core/user/reload.d.ts +3 -1
- package/dist/esm2017/src/core/user/token_manager.d.ts +1 -0
- package/dist/esm2017/src/core/user/user_impl.d.ts +7 -1
- package/dist/esm2017/src/core/util/assert.d.ts +1 -0
- package/dist/esm2017/src/model/public_types.d.ts +7 -0
- package/dist/esm2017/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/esm2017/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/esm2017/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/esm2017/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/esm2017/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/esm5/{index-3bd54529.js → index-dcfb76ea.js} +238 -30
- package/dist/esm5/index-dcfb76ea.js.map +1 -0
- package/dist/esm5/index.js +2 -2
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/esm5/src/core/index.d.ts +9 -1
- package/dist/esm5/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/esm5/src/core/strategies/credential.d.ts +6 -0
- package/dist/esm5/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/esm5/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/esm5/src/core/strategies/email_link.d.ts +4 -0
- package/dist/esm5/src/core/user/account_info.d.ts +3 -0
- package/dist/esm5/src/core/user/reload.d.ts +3 -1
- package/dist/esm5/src/core/user/token_manager.d.ts +1 -0
- package/dist/esm5/src/core/user/user_impl.d.ts +7 -1
- package/dist/esm5/src/core/util/assert.d.ts +1 -0
- package/dist/esm5/src/model/public_types.d.ts +7 -0
- package/dist/esm5/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/esm5/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/esm5/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/esm5/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/esm5/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/index.webworker.esm5.js +178 -11
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/internal.js +4 -1
- package/dist/node/internal.js.map +1 -1
- package/dist/node/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/node/src/core/index.d.ts +9 -1
- package/dist/node/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/node/src/core/strategies/credential.d.ts +6 -0
- package/dist/node/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/node/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/node/src/core/strategies/email_link.d.ts +4 -0
- package/dist/node/src/core/user/account_info.d.ts +3 -0
- package/dist/node/src/core/user/reload.d.ts +3 -1
- package/dist/node/src/core/user/token_manager.d.ts +1 -0
- package/dist/node/src/core/user/user_impl.d.ts +7 -1
- package/dist/node/src/core/util/assert.d.ts +1 -0
- package/dist/node/src/model/public_types.d.ts +7 -0
- package/dist/node/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/node/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/node/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/node/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/node/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/node/{totp-7d693c11.js → totp-fbe187a4.js} +180 -12
- package/dist/node/totp-fbe187a4.js.map +1 -0
- package/dist/node-esm/index.js +2 -2
- package/dist/node-esm/internal.js +6 -3
- package/dist/node-esm/internal.js.map +1 -1
- package/dist/node-esm/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/node-esm/src/core/index.d.ts +9 -1
- package/dist/node-esm/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/node-esm/src/core/strategies/credential.d.ts +6 -0
- package/dist/node-esm/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/node-esm/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/node-esm/src/core/strategies/email_link.d.ts +4 -0
- package/dist/node-esm/src/core/user/account_info.d.ts +3 -0
- package/dist/node-esm/src/core/user/reload.d.ts +3 -1
- package/dist/node-esm/src/core/user/token_manager.d.ts +1 -0
- package/dist/node-esm/src/core/user/user_impl.d.ts +7 -1
- package/dist/node-esm/src/core/util/assert.d.ts +1 -0
- package/dist/node-esm/src/model/public_types.d.ts +7 -0
- package/dist/node-esm/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/node-esm/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/node-esm/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/node-esm/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/node-esm/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/node-esm/{totp-56a8eeec.js → totp-4d1c9ab1.js} +148 -7
- package/dist/node-esm/totp-4d1c9ab1.js.map +1 -0
- package/dist/rn/{index-8ee80bdc.js → index-bbdaa838.js} +199 -16
- package/dist/rn/index-bbdaa838.js.map +1 -0
- package/dist/rn/index.js +1 -1
- package/dist/rn/internal.js +41 -15
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/rn/src/core/index.d.ts +9 -1
- package/dist/rn/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/rn/src/core/strategies/credential.d.ts +6 -0
- package/dist/rn/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/rn/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/rn/src/core/strategies/email_link.d.ts +4 -0
- package/dist/rn/src/core/user/account_info.d.ts +3 -0
- package/dist/rn/src/core/user/reload.d.ts +3 -1
- package/dist/rn/src/core/user/token_manager.d.ts +1 -0
- package/dist/rn/src/core/user/user_impl.d.ts +7 -1
- package/dist/rn/src/core/util/assert.d.ts +1 -0
- package/dist/rn/src/model/public_types.d.ts +7 -0
- package/dist/rn/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/rn/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/rn/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/rn/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/rn/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/src/core/index.d.ts +9 -1
- package/dist/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/src/core/strategies/credential.d.ts +6 -0
- package/dist/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/src/core/strategies/email_link.d.ts +4 -0
- package/dist/src/core/user/account_info.d.ts +3 -0
- package/dist/src/core/user/reload.d.ts +3 -1
- package/dist/src/core/user/token_manager.d.ts +1 -0
- package/dist/src/core/user/user_impl.d.ts +7 -1
- package/dist/src/core/util/assert.d.ts +1 -0
- package/dist/src/model/public_types.d.ts +7 -0
- package/dist/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/web-extension-cjs/index.js +1 -1
- package/dist/web-extension-cjs/internal.js +57 -18
- package/dist/web-extension-cjs/internal.js.map +1 -1
- package/dist/web-extension-cjs/{register-9438f377.js → register-4ce22251.js} +148 -6
- package/dist/web-extension-cjs/register-4ce22251.js.map +1 -0
- package/dist/web-extension-cjs/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/web-extension-cjs/src/core/index.d.ts +9 -1
- package/dist/web-extension-cjs/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/web-extension-cjs/src/core/strategies/credential.d.ts +6 -0
- package/dist/web-extension-cjs/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/web-extension-cjs/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/web-extension-cjs/src/core/strategies/email_link.d.ts +4 -0
- package/dist/web-extension-cjs/src/core/user/account_info.d.ts +3 -0
- package/dist/web-extension-cjs/src/core/user/reload.d.ts +3 -1
- package/dist/web-extension-cjs/src/core/user/token_manager.d.ts +1 -0
- package/dist/web-extension-cjs/src/core/user/user_impl.d.ts +7 -1
- package/dist/web-extension-cjs/src/core/util/assert.d.ts +1 -0
- package/dist/web-extension-cjs/src/model/public_types.d.ts +7 -0
- package/dist/web-extension-cjs/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/web-extension-cjs/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/web-extension-cjs/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/web-extension-cjs/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/web-extension-cjs/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/dist/web-extension-esm2017/index.js +2 -2
- package/dist/web-extension-esm2017/internal.js +58 -19
- package/dist/web-extension-esm2017/internal.js.map +1 -1
- package/dist/web-extension-esm2017/{register-7b89e556.js → register-3473374b.js} +148 -7
- package/dist/web-extension-esm2017/register-3473374b.js.map +1 -0
- package/dist/web-extension-esm2017/src/core/auth/auth_impl.d.ts +1 -0
- package/dist/web-extension-esm2017/src/core/index.d.ts +9 -1
- package/dist/web-extension-esm2017/src/core/strategies/anonymous.d.ts +3 -0
- package/dist/web-extension-esm2017/src/core/strategies/credential.d.ts +6 -0
- package/dist/web-extension-esm2017/src/core/strategies/custom_token.d.ts +3 -0
- package/dist/web-extension-esm2017/src/core/strategies/email_and_password.d.ts +7 -0
- package/dist/web-extension-esm2017/src/core/strategies/email_link.d.ts +4 -0
- package/dist/web-extension-esm2017/src/core/user/account_info.d.ts +3 -0
- package/dist/web-extension-esm2017/src/core/user/reload.d.ts +3 -1
- package/dist/web-extension-esm2017/src/core/user/token_manager.d.ts +1 -0
- package/dist/web-extension-esm2017/src/core/user/user_impl.d.ts +7 -1
- package/dist/web-extension-esm2017/src/core/util/assert.d.ts +1 -0
- package/dist/web-extension-esm2017/src/model/public_types.d.ts +7 -0
- package/dist/web-extension-esm2017/src/platform_browser/strategies/phone.d.ts +6 -3
- package/dist/web-extension-esm2017/src/platform_browser/strategies/popup.d.ts +4 -2
- package/dist/web-extension-esm2017/src/platform_browser/strategies/redirect.d.ts +8 -4
- package/dist/web-extension-esm2017/test/helpers/integration/helpers.d.ts +2 -0
- package/dist/web-extension-esm2017/test/integration/flows/firebaseserverapp.test.d.ts +17 -0
- package/package.json +7 -7
- package/dist/browser-cjs/index-6a907fc6.js.map +0 -1
- package/dist/cordova/popup_redirect-58faecee.js.map +0 -1
- package/dist/esm2017/index-e939beb5.js.map +0 -1
- package/dist/esm5/index-3bd54529.js.map +0 -1
- package/dist/node/totp-7d693c11.js.map +0 -1
- package/dist/node-esm/totp-56a8eeec.js.map +0 -1
- package/dist/rn/index-8ee80bdc.js.map +0 -1
- package/dist/web-extension-cjs/register-9438f377.js.map +0 -1
- package/dist/web-extension-esm2017/register-7b89e556.js.map +0 -1
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
6
|
-
require('@firebase/util');
|
|
5
|
+
var index = require('./index-fcf80d66.js');
|
|
7
6
|
require('@firebase/app');
|
|
7
|
+
require('@firebase/util');
|
|
8
8
|
require('@firebase/logger');
|
|
9
9
|
require('tslib');
|
|
10
10
|
require('@firebase/component');
|
|
@@ -68,6 +68,7 @@ export declare class AuthImpl implements AuthInternal, _FirebaseService {
|
|
|
68
68
|
* If the persistence is changed in another window, the user manager will let us know
|
|
69
69
|
*/
|
|
70
70
|
_onStorageEvent(): Promise<void>;
|
|
71
|
+
private initializeCurrentUserFromIdToken;
|
|
71
72
|
private initializeCurrentUser;
|
|
72
73
|
private tryRedirectSignIn;
|
|
73
74
|
private reloadAndSetCurrentUserOrClear;
|
|
@@ -26,7 +26,8 @@ export { debugErrorMap, prodErrorMap, AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY
|
|
|
26
26
|
* remembered or not. It also makes it easier to never persist the `Auth` state for applications
|
|
27
27
|
* that are shared by other users or have sensitive data.
|
|
28
28
|
*
|
|
29
|
-
* This method does not work in a Node.js environment
|
|
29
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
30
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
30
31
|
*
|
|
31
32
|
* @example
|
|
32
33
|
* ```javascript
|
|
@@ -157,6 +158,9 @@ export declare function useDeviceLanguage(auth: Auth): void;
|
|
|
157
158
|
* The operation fails with an error if the user to be updated belongs to a different Firebase
|
|
158
159
|
* project.
|
|
159
160
|
*
|
|
161
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
162
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
163
|
+
*
|
|
160
164
|
* @param auth - The {@link Auth} instance.
|
|
161
165
|
* @param user - The new {@link User}.
|
|
162
166
|
*
|
|
@@ -166,6 +170,10 @@ export declare function updateCurrentUser(auth: Auth, user: User | null): Promis
|
|
|
166
170
|
/**
|
|
167
171
|
* Signs out the current user.
|
|
168
172
|
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
175
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
176
|
+
*
|
|
169
177
|
* @param auth - The {@link Auth} instance.
|
|
170
178
|
*
|
|
171
179
|
* @public
|
|
@@ -22,6 +22,9 @@ import { Auth, UserCredential } from '../../model/public_types';
|
|
|
22
22
|
* If there is already an anonymous user signed in, that user will be returned; otherwise, a
|
|
23
23
|
* new anonymous user identity will be created and returned.
|
|
24
24
|
*
|
|
25
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
26
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
27
|
+
*
|
|
25
28
|
* @param auth - The {@link Auth} instance.
|
|
26
29
|
*
|
|
27
30
|
* @public
|
|
@@ -24,6 +24,9 @@ export declare function _signInWithCredential(auth: AuthInternal, credential: Au
|
|
|
24
24
|
* @remarks
|
|
25
25
|
* An {@link AuthProvider} can be used to generate the credential.
|
|
26
26
|
*
|
|
27
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
28
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
29
|
+
*
|
|
27
30
|
* @param auth - The {@link Auth} instance.
|
|
28
31
|
* @param credential - The auth credential.
|
|
29
32
|
*
|
|
@@ -50,6 +53,9 @@ export declare function linkWithCredential(user: User, credential: AuthCredentia
|
|
|
50
53
|
* attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error
|
|
51
54
|
* or a `TOKEN_EXPIRED` error.
|
|
52
55
|
*
|
|
56
|
+
* This method is not supported on any {@link User} signed in by {@link Auth} instances
|
|
57
|
+
* created with a {@link @firebase/app#FirebaseServerApp}.
|
|
58
|
+
*
|
|
53
59
|
* @param user - The user.
|
|
54
60
|
* @param credential - The auth credential.
|
|
55
61
|
*
|
|
@@ -26,6 +26,9 @@ import { Auth, UserCredential } from '../../model/public_types';
|
|
|
26
26
|
*
|
|
27
27
|
* Fails with an error if the token is invalid, expired, or not accepted by the Firebase Auth service.
|
|
28
28
|
*
|
|
29
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
30
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
31
|
+
*
|
|
29
32
|
* @param auth - The {@link Auth} instance.
|
|
30
33
|
* @param customToken - The custom token to sign in with.
|
|
31
34
|
*
|
|
@@ -99,6 +99,9 @@ export declare function verifyPasswordResetCode(auth: Auth, code: string): Promi
|
|
|
99
99
|
*
|
|
100
100
|
* User account creation can fail if the account already exists or the password is invalid.
|
|
101
101
|
*
|
|
102
|
+
* This method is not supported on {@link Auth} instances created with a
|
|
103
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
104
|
+
*
|
|
102
105
|
* Note: The email address acts as a unique identifier for the user and enables an email-based
|
|
103
106
|
* password reset. This function will create a new user account and set the initial user password.
|
|
104
107
|
*
|
|
@@ -117,10 +120,14 @@ export declare function createUserWithEmailAndPassword(auth: Auth, email: string
|
|
|
117
120
|
* When [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled,
|
|
118
121
|
* this method fails with "auth/invalid-credential" in case of an invalid email/password.
|
|
119
122
|
*
|
|
123
|
+
* This method is not supported on {@link Auth} instances created with a
|
|
124
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
125
|
+
*
|
|
120
126
|
* Note: The user's password is NOT the password used to access the user's email account. The
|
|
121
127
|
* email address serves as a unique identifier for the user, and the password is used to access
|
|
122
128
|
* the user's account in your Firebase project. See also: {@link createUserWithEmailAndPassword}.
|
|
123
129
|
*
|
|
130
|
+
*
|
|
124
131
|
* @param auth - The {@link Auth} instance.
|
|
125
132
|
* @param email - The users email address.
|
|
126
133
|
* @param password - The users password.
|
|
@@ -71,6 +71,9 @@ export declare function isSignInWithEmailLink(auth: Auth, emailLink: string): bo
|
|
|
71
71
|
*
|
|
72
72
|
* Fails with an error if the email address is invalid or OTP in email link expires.
|
|
73
73
|
*
|
|
74
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
75
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
76
|
+
*
|
|
74
77
|
* Note: Confirm the link is a sign-in email link before calling this method firebase.auth.Auth.isSignInWithEmailLink.
|
|
75
78
|
*
|
|
76
79
|
* @example
|
|
@@ -94,6 +97,7 @@ export declare function isSignInWithEmailLink(auth: Auth, emailLink: string): bo
|
|
|
94
97
|
* }
|
|
95
98
|
* ```
|
|
96
99
|
*
|
|
100
|
+
*
|
|
97
101
|
* @param auth - The {@link Auth} instance.
|
|
98
102
|
* @param email - The user's email address.
|
|
99
103
|
* @param emailLink - The link sent to the user's email address.
|
|
@@ -34,6 +34,9 @@ export declare function updateProfile(user: User, { displayName, photoURL: photo
|
|
|
34
34
|
* An email will be sent to the original email address (if it was set) that allows to revoke the
|
|
35
35
|
* email address change, in order to protect them from account hijacking.
|
|
36
36
|
*
|
|
37
|
+
* This method is not supported on any {@link User} signed in by {@link Auth} instances
|
|
38
|
+
* created with a {@link @firebase/app#FirebaseServerApp}.
|
|
39
|
+
*
|
|
37
40
|
* Important: this is a security sensitive operation that requires the user to have recently signed
|
|
38
41
|
* in. If this requirement isn't met, ask the user to authenticate again and then call
|
|
39
42
|
* {@link reauthenticateWithCredential}.
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { User } from '../../model/public_types';
|
|
17
|
+
import { User, UserInfo } from '../../model/public_types';
|
|
18
|
+
import { ProviderUserInfo } from '../../api/account_management/account';
|
|
18
19
|
import { UserInternal } from '../../model/user';
|
|
19
20
|
export declare function _reloadWithoutSaving(user: UserInternal): Promise<void>;
|
|
20
21
|
/**
|
|
@@ -25,3 +26,4 @@ export declare function _reloadWithoutSaving(user: UserInternal): Promise<void>;
|
|
|
25
26
|
* @public
|
|
26
27
|
*/
|
|
27
28
|
export declare function reload(user: User): Promise<void>;
|
|
29
|
+
export declare function extractProviderData(providers: ProviderUserInfo[]): UserInfo[];
|
|
@@ -37,6 +37,7 @@ export declare class StsTokenManager {
|
|
|
37
37
|
expirationTime: number | null;
|
|
38
38
|
get isExpired(): boolean;
|
|
39
39
|
updateFromServerResponse(response: IdTokenResponse | FinalizeMfaResponse): void;
|
|
40
|
+
updateFromIdToken(idToken: string): void;
|
|
40
41
|
getToken(auth: AuthInternal, forceRefresh?: boolean): Promise<string | null>;
|
|
41
42
|
clearRefreshToken(): void;
|
|
42
43
|
private refresh;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { IdTokenResult } from '../../model/public_types';
|
|
18
18
|
import { NextFn } from '@firebase/util';
|
|
19
|
-
import { APIUserInfo } from '../../api/account_management/account';
|
|
19
|
+
import { APIUserInfo, GetAccountInfoResponse } from '../../api/account_management/account';
|
|
20
20
|
import { FinalizeMfaResponse } from '../../api/authentication/mfa';
|
|
21
21
|
import { AuthInternal } from '../../model/auth';
|
|
22
22
|
import { IdTokenResponse } from '../../model/id_token';
|
|
@@ -65,4 +65,10 @@ export declare class UserImpl implements UserInternal {
|
|
|
65
65
|
* @param idTokenResponse
|
|
66
66
|
*/
|
|
67
67
|
static _fromIdTokenResponse(auth: AuthInternal, idTokenResponse: IdTokenResponse, isAnonymous?: boolean): Promise<UserInternal>;
|
|
68
|
+
/**
|
|
69
|
+
* Initialize a User from an idToken server response
|
|
70
|
+
* @param auth
|
|
71
|
+
* @param idTokenResponse
|
|
72
|
+
*/
|
|
73
|
+
static _fromGetAccountInfoResponse(auth: AuthInternal, response: GetAccountInfoResponse, idToken: string): Promise<UserInternal>;
|
|
68
74
|
}
|
|
@@ -38,6 +38,7 @@ export declare function _fail<K extends AuthErrorCode>(auth: Auth, code: K, ...d
|
|
|
38
38
|
export declare function _createError<K extends AuthErrorCode>(code: K, ...data: {} extends AuthErrorParams[K] ? [AuthErrorParams[K]?] : [AuthErrorParams[K]]): FirebaseError;
|
|
39
39
|
export declare function _createError<K extends AuthErrorCode>(auth: Auth, code: K, ...data: {} extends LessAppName<K> ? [LessAppName<K>?] : [LessAppName<K>]): FirebaseError;
|
|
40
40
|
export declare function _errorWithCustomMessage(auth: Auth, code: AuthErrorCode, message: string): FirebaseError;
|
|
41
|
+
export declare function _serverAppCurrentUserOperationNotSupportedError(auth: Auth): FirebaseError;
|
|
41
42
|
export declare function _assertInstanceOf(auth: Auth, object: object, instance: unknown): void;
|
|
42
43
|
export declare function _assert<K extends AuthErrorCode>(assertion: unknown, code: K, ...data: {} extends AuthErrorParams[K] ? [AuthErrorParams[K]?] : [AuthErrorParams[K]]): asserts assertion;
|
|
43
44
|
export declare function _assert<K extends AuthErrorCode>(assertion: unknown, auth: Auth, code: K, ...data: {} extends LessAppName<K> ? [LessAppName<K>?] : [LessAppName<K>]): asserts assertion;
|
|
@@ -287,6 +287,10 @@ export interface Auth {
|
|
|
287
287
|
useDeviceLanguage(): void;
|
|
288
288
|
/**
|
|
289
289
|
* Signs out the current user. This does not automatically revoke the user's ID token.
|
|
290
|
+
*
|
|
291
|
+
* @remarks
|
|
292
|
+
* This method is not supported by {@link Auth} instances created with a
|
|
293
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
290
294
|
*/
|
|
291
295
|
signOut(): Promise<void>;
|
|
292
296
|
}
|
|
@@ -943,6 +947,9 @@ export interface User extends UserInfo {
|
|
|
943
947
|
* Important: this is a security-sensitive operation that requires the user to have recently
|
|
944
948
|
* signed in. If this requirement isn't met, ask the user to authenticate again and then call
|
|
945
949
|
* one of the reauthentication methods like {@link reauthenticateWithCredential}.
|
|
950
|
+
*
|
|
951
|
+
* This method is not supported on any {@link User} signed in by {@link Auth} instances
|
|
952
|
+
* created with a {@link @firebase/app#FirebaseServerApp}.
|
|
946
953
|
*/
|
|
947
954
|
delete(): Promise<void>;
|
|
948
955
|
/**
|
|
@@ -33,7 +33,8 @@ import { AuthInternal } from '../../model/auth';
|
|
|
33
33
|
* {@link RecaptchaVerifier} (like React Native), but you need to use a
|
|
34
34
|
* third-party {@link ApplicationVerifier} implementation.
|
|
35
35
|
*
|
|
36
|
-
* This method does not work in a Node.js environment
|
|
36
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
37
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
37
38
|
*
|
|
38
39
|
* @example
|
|
39
40
|
* ```javascript
|
|
@@ -70,7 +71,8 @@ export declare function linkWithPhoneNumber(user: User, phoneNumber: string, app
|
|
|
70
71
|
* @remarks
|
|
71
72
|
* Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.
|
|
72
73
|
*
|
|
73
|
-
* This method does not work in a Node.js environment
|
|
74
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
75
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
74
76
|
*
|
|
75
77
|
* @param user - The user.
|
|
76
78
|
* @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).
|
|
@@ -88,7 +90,8 @@ export declare function _verifyPhoneNumber(auth: AuthInternal, options: PhoneInf
|
|
|
88
90
|
* Updates the user's phone number.
|
|
89
91
|
*
|
|
90
92
|
* @remarks
|
|
91
|
-
* This method does not work in a Node.js environment
|
|
93
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
94
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
92
95
|
*
|
|
93
96
|
* @example
|
|
94
97
|
* ```
|
|
@@ -27,7 +27,8 @@ export declare const _POLL_WINDOW_CLOSE_TIMEOUT: Delay;
|
|
|
27
27
|
* If succeeds, returns the signed in user along with the provider's credential. If sign in was
|
|
28
28
|
* unsuccessful, returns an error object containing additional information about the error.
|
|
29
29
|
*
|
|
30
|
-
* This method does not work in a Node.js environment
|
|
30
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
31
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
31
32
|
*
|
|
32
33
|
* @example
|
|
33
34
|
* ```javascript
|
|
@@ -59,7 +60,8 @@ export declare function signInWithPopup(auth: Auth, provider: AuthProvider, reso
|
|
|
59
60
|
* If the reauthentication is successful, the returned result will contain the user and the
|
|
60
61
|
* provider's credential.
|
|
61
62
|
*
|
|
62
|
-
* This method does not work in a Node.js environment
|
|
63
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
64
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
63
65
|
*
|
|
64
66
|
* @example
|
|
65
67
|
* ```javascript
|
|
@@ -23,7 +23,8 @@ import { Auth, AuthProvider, PopupRedirectResolver, User, UserCredential } from
|
|
|
23
23
|
* Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices
|
|
24
24
|
* | best practices} when using {@link signInWithRedirect}.
|
|
25
25
|
*
|
|
26
|
-
* This method does not work in a Node.js environment
|
|
26
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
27
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
27
28
|
*
|
|
28
29
|
* @example
|
|
29
30
|
* ```javascript
|
|
@@ -67,7 +68,8 @@ export declare function _signInWithRedirect(auth: Auth, provider: AuthProvider,
|
|
|
67
68
|
* Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices
|
|
68
69
|
* | best practices} when using {@link reauthenticateWithRedirect}.
|
|
69
70
|
*
|
|
70
|
-
* This method does not work in a Node.js environment
|
|
71
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances
|
|
72
|
+
* created with a {@link @firebase/app#FirebaseServerApp}.
|
|
71
73
|
*
|
|
72
74
|
* @example
|
|
73
75
|
* ```javascript
|
|
@@ -103,7 +105,8 @@ export declare function _reauthenticateWithRedirect(user: User, provider: AuthPr
|
|
|
103
105
|
* Follow the {@link https://firebase.google.com/docs/auth/web/redirect-best-practices
|
|
104
106
|
* | best practices} when using {@link linkWithRedirect}.
|
|
105
107
|
*
|
|
106
|
-
* This method does not work in a Node.js environment
|
|
108
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances
|
|
109
|
+
* created with a {@link @firebase/app#FirebaseServerApp}.
|
|
107
110
|
*
|
|
108
111
|
* @example
|
|
109
112
|
* ```javascript
|
|
@@ -135,7 +138,8 @@ export declare function _linkWithRedirect(user: User, provider: AuthProvider, re
|
|
|
135
138
|
* If sign-in succeeded, returns the signed in user. If sign-in was unsuccessful, fails with an
|
|
136
139
|
* error. If no redirect operation was called, returns `null`.
|
|
137
140
|
*
|
|
138
|
-
* This method does not work in a Node.js environment
|
|
141
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
142
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
139
143
|
*
|
|
140
144
|
* @example
|
|
141
145
|
* ```javascript
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
import { FirebaseServerApp } from '@firebase/app';
|
|
17
18
|
import { Auth } from '@firebase/auth';
|
|
18
19
|
export declare function randomEmail(): string;
|
|
19
20
|
export declare function getTestInstance(requireEmulator?: boolean): Auth;
|
|
21
|
+
export declare function getTestInstanceForServerApp(serverApp: FirebaseServerApp): Auth;
|
|
20
22
|
export declare function cleanUpTestInstance(auth: Auth): Promise<void>;
|
|
21
23
|
export declare function getTotpCode(sharedSecretKey: string, periodSec: number, verificationCodeLength: number, timestamp: Date): string;
|
|
22
24
|
export declare const email = "totpuser-donotdelete@test.com";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
package/dist/cordova/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getApp, _getProvider } from '@firebase/app';
|
|
2
|
-
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-
|
|
3
|
-
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes, E as EmailAuthCredential, D as EmailAuthProvider, G as FacebookAuthProvider, F as FactorId, I as GithubAuthProvider, H as GoogleAuthProvider, z as OAuthCredential, J as OAuthProvider, O as OperationType, B as PhoneAuthCredential, P as ProviderId, K as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, W as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, X as checkActionCode, V as confirmPasswordReset, x as connectAuthEmulator, d as cordovaPopupRedirectResolver, Z as createUserWithEmailAndPassword, q as debugErrorMap, p as deleteUser, a3 as fetchSignInMethodsForEmail, ae as getAdditionalUserInfo, ab as getIdToken, ac as getIdTokenResult, ag as getMultiFactorResolver, g as getRedirectResult, C as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, a1 as isSignInWithEmailLink, N as linkWithCredential, ah as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a7 as parseActionCodeURL, t as prodErrorMap, Q as reauthenticateWithCredential, af as reload, n as revokeAccessToken, a4 as sendEmailVerification, U as sendPasswordResetEmail, a0 as sendSignInLinkToEmail, s as setPersistence, L as signInAnonymously, M as signInWithCredential, R as signInWithCustomToken, $ as signInWithEmailAndPassword, a2 as signInWithEmailLink, m as signOut, ad as unlink, l as updateCurrentUser, a9 as updateEmail, aa as updatePassword, a8 as updateProfile, u as useDeviceLanguage, v as validatePassword, a5 as verifyBeforeUpdateEmail, Y as verifyPasswordResetCode } from './popup_redirect-
|
|
2
|
+
import { _ as _signInWithRedirect, a as _reauthenticateWithRedirect, b as _linkWithRedirect, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, d as cordovaPopupRedirectResolver } from './popup_redirect-65e04583.js';
|
|
3
|
+
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes, E as EmailAuthCredential, D as EmailAuthProvider, G as FacebookAuthProvider, F as FactorId, I as GithubAuthProvider, H as GoogleAuthProvider, z as OAuthCredential, J as OAuthProvider, O as OperationType, B as PhoneAuthCredential, P as ProviderId, K as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, W as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, X as checkActionCode, V as confirmPasswordReset, x as connectAuthEmulator, d as cordovaPopupRedirectResolver, Z as createUserWithEmailAndPassword, q as debugErrorMap, p as deleteUser, a3 as fetchSignInMethodsForEmail, ae as getAdditionalUserInfo, ab as getIdToken, ac as getIdTokenResult, ag as getMultiFactorResolver, g as getRedirectResult, C as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, a1 as isSignInWithEmailLink, N as linkWithCredential, ah as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a7 as parseActionCodeURL, t as prodErrorMap, Q as reauthenticateWithCredential, af as reload, n as revokeAccessToken, a4 as sendEmailVerification, U as sendPasswordResetEmail, a0 as sendSignInLinkToEmail, s as setPersistence, L as signInAnonymously, M as signInWithCredential, R as signInWithCustomToken, $ as signInWithEmailAndPassword, a2 as signInWithEmailLink, m as signOut, ad as unlink, l as updateCurrentUser, a9 as updateEmail, aa as updatePassword, a8 as updateProfile, u as useDeviceLanguage, v as validatePassword, a5 as verifyBeforeUpdateEmail, Y as verifyPasswordResetCode } from './popup_redirect-65e04583.js';
|
|
4
4
|
import 'tslib';
|
|
5
5
|
import '@firebase/util';
|
|
6
6
|
import '@firebase/component';
|
package/dist/cordova/internal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as _assert, al as Delay, am as _window, an as isV2, ao as _createError, ap as _recaptchaV2ScriptUrl, aq as _loadJS, ar as _generateCallbackName, as as getRecaptchaParams, at as _isHttpOrHttps, au as _isWorker, av as _castAuth, M as signInWithCredential, N as linkWithCredential,
|
|
2
|
-
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes,
|
|
1
|
+
import { ai as _performApiRequest, aj as _addTidIfNecessary, ak as _assert, al as Delay, am as _window, an as isV2, ao as _createError, ap as _recaptchaV2ScriptUrl, aq as _loadJS, ar as _generateCallbackName, as as getRecaptchaParams, at as _isHttpOrHttps, au as _isWorker, av as _castAuth, M as signInWithCredential, aw as _serverAppCurrentUserOperationNotSupportedError, N as linkWithCredential, ax as _assertLinkedStatus, Q as reauthenticateWithCredential, ay as sendPhoneVerificationCode, az as startEnrollPhoneMfa, aA as _link, B as PhoneAuthCredential, aB as debugAssert, aC as _generateEventId, aD as AbstractPopupRedirectOperation, aE as _assertInstanceOf, aF as _withDefaultResolver, aG as FederatedAuthProvider, aH as _fail, aI as _getProjectConfig, aJ as _getCurrentUrl, aK as _gapiScriptUrl, aL as _emulatorUrl, aM as _isChromeIOS, aN as _isFirefox, aO as _isIOSStandalone, aP as _getRedirectUrl, aQ as _setWindowLocation, aR as _isMobileBrowser, aS as _isSafari, aT as _isIOS, f as browserSessionPersistence, aU as _getRedirectResult, aV as _overrideRedirectResult, aW as AuthEventManager, aX as debugFail, aY as finalizeEnrollPhoneMfa, aZ as finalizeEnrollTotpMfa, a_ as startEnrollTotpMfa, r as registerAuth, i as initializeAuth, c as indexedDBLocalPersistence, e as browserLocalPersistence, j as beforeAuthStateChanged, o as onIdTokenChanged, x as connectAuthEmulator, a$ as _setExternalJSProvider } from './popup_redirect-65e04583.js';
|
|
2
|
+
export { A as ActionCodeOperation, a6 as ActionCodeURL, y as AuthCredential, w as AuthErrorCodes, b3 as AuthImpl, E as EmailAuthCredential, D as EmailAuthProvider, G as FacebookAuthProvider, F as FactorId, b5 as FetchProvider, I as GithubAuthProvider, H as GoogleAuthProvider, z as OAuthCredential, J as OAuthProvider, O as OperationType, B as PhoneAuthCredential, P as ProviderId, b6 as SAMLAuthCredential, K as SAMLAuthProvider, S as SignInMethod, T as TwitterAuthProvider, b1 as UserImpl, ak as _assert, av as _castAuth, aH as _fail, aC as _generateEventId, b4 as _getClientVersion, b2 as _getInstance, aU as _getRedirectResult, aV as _overrideRedirectResult, b0 as _persistenceKeyName, W as applyActionCode, j as beforeAuthStateChanged, e as browserLocalPersistence, f as browserSessionPersistence, X as checkActionCode, V as confirmPasswordReset, x as connectAuthEmulator, d as cordovaPopupRedirectResolver, Z as createUserWithEmailAndPassword, q as debugErrorMap, p as deleteUser, a3 as fetchSignInMethodsForEmail, ae as getAdditionalUserInfo, ab as getIdToken, ac as getIdTokenResult, ag as getMultiFactorResolver, g as getRedirectResult, C as inMemoryPersistence, c as indexedDBLocalPersistence, i as initializeAuth, h as initializeRecaptchaConfig, a1 as isSignInWithEmailLink, N as linkWithCredential, b8 as linkWithRedirect, ah as multiFactor, k as onAuthStateChanged, o as onIdTokenChanged, a7 as parseActionCodeURL, t as prodErrorMap, Q as reauthenticateWithCredential, b9 as reauthenticateWithRedirect, af as reload, n as revokeAccessToken, a4 as sendEmailVerification, U as sendPasswordResetEmail, a0 as sendSignInLinkToEmail, s as setPersistence, L as signInAnonymously, M as signInWithCredential, R as signInWithCustomToken, $ as signInWithEmailAndPassword, a2 as signInWithEmailLink, b7 as signInWithRedirect, m as signOut, ad as unlink, l as updateCurrentUser, a9 as updateEmail, aa as updatePassword, a8 as updateProfile, u as useDeviceLanguage, v as validatePassword, a5 as verifyBeforeUpdateEmail, Y as verifyPasswordResetCode } from './popup_redirect-65e04583.js';
|
|
3
3
|
import { __awaiter, __generator, __assign, __extends, __spreadArray } from 'tslib';
|
|
4
4
|
import { querystring, getModularInstance, getUA, getExperimentalSetting, getDefaultEmulatorHost } from '@firebase/util';
|
|
5
|
-
import { SDK_VERSION, getApp, _getProvider } from '@firebase/app';
|
|
5
|
+
import { _isFirebaseServerApp, SDK_VERSION, getApp, _getProvider } from '@firebase/app';
|
|
6
6
|
import '@firebase/component';
|
|
7
7
|
import '@firebase/logger';
|
|
8
8
|
|
|
@@ -581,7 +581,8 @@ var ConfirmationResultImpl = /** @class */ (function () {
|
|
|
581
581
|
* {@link RecaptchaVerifier} (like React Native), but you need to use a
|
|
582
582
|
* third-party {@link ApplicationVerifier} implementation.
|
|
583
583
|
*
|
|
584
|
-
* This method does not work in a Node.js environment
|
|
584
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
585
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
585
586
|
*
|
|
586
587
|
* @example
|
|
587
588
|
* ```javascript
|
|
@@ -604,6 +605,9 @@ function signInWithPhoneNumber(auth, phoneNumber, appVerifier) {
|
|
|
604
605
|
return __generator(this, function (_a) {
|
|
605
606
|
switch (_a.label) {
|
|
606
607
|
case 0:
|
|
608
|
+
if (_isFirebaseServerApp(auth.app)) {
|
|
609
|
+
return [2 /*return*/, Promise.reject(_serverAppCurrentUserOperationNotSupportedError(auth))];
|
|
610
|
+
}
|
|
607
611
|
authInternal = _castAuth(auth);
|
|
608
612
|
return [4 /*yield*/, _verifyPhoneNumber(authInternal, phoneNumber, getModularInstance(appVerifier))];
|
|
609
613
|
case 1:
|
|
@@ -653,7 +657,8 @@ function linkWithPhoneNumber(user, phoneNumber, appVerifier) {
|
|
|
653
657
|
* @remarks
|
|
654
658
|
* Use before operations such as {@link updatePassword} that require tokens from recent sign-in attempts.
|
|
655
659
|
*
|
|
656
|
-
* This method does not work in a Node.js environment
|
|
660
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
661
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
657
662
|
*
|
|
658
663
|
* @param user - The user.
|
|
659
664
|
* @param phoneNumber - The user's phone number in E.164 format (e.g. +16505550101).
|
|
@@ -668,6 +673,9 @@ function reauthenticateWithPhoneNumber(user, phoneNumber, appVerifier) {
|
|
|
668
673
|
switch (_a.label) {
|
|
669
674
|
case 0:
|
|
670
675
|
userInternal = getModularInstance(user);
|
|
676
|
+
if (_isFirebaseServerApp(userInternal.auth.app)) {
|
|
677
|
+
return [2 /*return*/, Promise.reject(_serverAppCurrentUserOperationNotSupportedError(userInternal.auth))];
|
|
678
|
+
}
|
|
671
679
|
return [4 /*yield*/, _verifyPhoneNumber(userInternal.auth, phoneNumber, getModularInstance(appVerifier))];
|
|
672
680
|
case 1:
|
|
673
681
|
verificationId = _a.sent();
|
|
@@ -755,7 +763,8 @@ function _verifyPhoneNumber(auth, options, verifier) {
|
|
|
755
763
|
* Updates the user's phone number.
|
|
756
764
|
*
|
|
757
765
|
* @remarks
|
|
758
|
-
* This method does not work in a Node.js environment
|
|
766
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
767
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
759
768
|
*
|
|
760
769
|
* @example
|
|
761
770
|
* ```
|
|
@@ -775,9 +784,15 @@ function _verifyPhoneNumber(auth, options, verifier) {
|
|
|
775
784
|
*/
|
|
776
785
|
function updatePhoneNumber(user, credential) {
|
|
777
786
|
return __awaiter(this, void 0, void 0, function () {
|
|
787
|
+
var userInternal;
|
|
778
788
|
return __generator(this, function (_a) {
|
|
779
789
|
switch (_a.label) {
|
|
780
|
-
case 0:
|
|
790
|
+
case 0:
|
|
791
|
+
userInternal = getModularInstance(user);
|
|
792
|
+
if (_isFirebaseServerApp(userInternal.auth.app)) {
|
|
793
|
+
return [2 /*return*/, Promise.reject(_serverAppCurrentUserOperationNotSupportedError(userInternal.auth))];
|
|
794
|
+
}
|
|
795
|
+
return [4 /*yield*/, _link(userInternal, credential)];
|
|
781
796
|
case 1:
|
|
782
797
|
_a.sent();
|
|
783
798
|
return [2 /*return*/];
|
|
@@ -980,7 +995,8 @@ var _POLL_WINDOW_CLOSE_TIMEOUT = new Delay(2000, 10000);
|
|
|
980
995
|
* If succeeds, returns the signed in user along with the provider's credential. If sign in was
|
|
981
996
|
* unsuccessful, returns an error object containing additional information about the error.
|
|
982
997
|
*
|
|
983
|
-
* This method does not work in a Node.js environment
|
|
998
|
+
* This method does not work in a Node.js environment or with {@link Auth} instances created with a
|
|
999
|
+
* {@link @firebase/app#FirebaseServerApp}.
|
|
984
1000
|
*
|
|
985
1001
|
* @example
|
|
986
1002
|
* ```javascript
|
|
@@ -1007,6 +1023,9 @@ function signInWithPopup(auth, provider, resolver) {
|
|
|
1007
1023
|
return __awaiter(this, void 0, void 0, function () {
|
|
1008
1024
|
var authInternal, resolverInternal, action;
|
|
1009
1025
|
return __generator(this, function (_a) {
|
|
1026
|
+
if (_isFirebaseServerApp(auth.app)) {
|
|
1027
|
+
return [2 /*return*/, Promise.reject(_createError(auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */))];
|
|
1028
|
+
}
|
|
1010
1029
|
authInternal = _castAuth(auth);
|
|
1011
1030
|
_assertInstanceOf(auth, provider, FederatedAuthProvider);
|
|
1012
1031
|
resolverInternal = _withDefaultResolver(authInternal, resolver);
|
|
@@ -1023,7 +1042,8 @@ function signInWithPopup(auth, provider, resolver) {
|
|
|
1023
1042
|
* If the reauthentication is successful, the returned result will contain the user and the
|
|
1024
1043
|
* provider's credential.
|
|
1025
1044
|
*
|
|
1026
|
-
* This method does not work in a Node.js environment
|
|
1045
|
+
* This method does not work in a Node.js environment or on any {@link User} signed in by
|
|
1046
|
+
* {@link Auth} instances created with a {@link @firebase/app#FirebaseServerApp}.
|
|
1027
1047
|
*
|
|
1028
1048
|
* @example
|
|
1029
1049
|
* ```javascript
|
|
@@ -1047,6 +1067,9 @@ function reauthenticateWithPopup(user, provider, resolver) {
|
|
|
1047
1067
|
var userInternal, resolverInternal, action;
|
|
1048
1068
|
return __generator(this, function (_a) {
|
|
1049
1069
|
userInternal = getModularInstance(user);
|
|
1070
|
+
if (_isFirebaseServerApp(userInternal.auth.app)) {
|
|
1071
|
+
return [2 /*return*/, Promise.reject(_createError(userInternal.auth, "operation-not-supported-in-this-environment" /* AuthErrorCode.OPERATION_NOT_SUPPORTED */))];
|
|
1072
|
+
}
|
|
1050
1073
|
_assertInstanceOf(userInternal.auth, provider, FederatedAuthProvider);
|
|
1051
1074
|
resolverInternal = _withDefaultResolver(userInternal.auth, resolver);
|
|
1052
1075
|
action = new PopupOperation(userInternal.auth, "reauthViaPopup" /* AuthEventType.REAUTH_VIA_POPUP */, provider, resolverInternal, userInternal);
|
|
@@ -2077,14 +2100,19 @@ function getAuth(app) {
|
|
|
2077
2100
|
]
|
|
2078
2101
|
});
|
|
2079
2102
|
var authTokenSyncPath = getExperimentalSetting('authTokenSyncURL');
|
|
2080
|
-
//
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2103
|
+
// Only do the Cookie exchange in a secure context
|
|
2104
|
+
if (authTokenSyncPath &&
|
|
2105
|
+
typeof isSecureContext === 'boolean' &&
|
|
2106
|
+
isSecureContext) {
|
|
2107
|
+
// Don't allow urls (XSS possibility), only paths on the same domain
|
|
2108
|
+
var authTokenSyncUrl = new URL(authTokenSyncPath, location.origin);
|
|
2109
|
+
if (location.origin === authTokenSyncUrl.origin) {
|
|
2110
|
+
var mintCookie_1 = mintCookieFactory(authTokenSyncUrl.toString());
|
|
2111
|
+
beforeAuthStateChanged(auth, mintCookie_1, function () {
|
|
2112
|
+
return mintCookie_1(auth.currentUser);
|
|
2113
|
+
});
|
|
2114
|
+
onIdTokenChanged(auth, function (user) { return mintCookie_1(user); });
|
|
2115
|
+
}
|
|
2088
2116
|
}
|
|
2089
2117
|
var authEmulatorHost = getDefaultEmulatorHost('auth');
|
|
2090
2118
|
if (authEmulatorHost) {
|