@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
|
@@ -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 {};
|
|
@@ -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;
|
package/dist/src/core/index.d.ts
CHANGED
|
@@ -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
|