Skip to content

Commit c4d10b5

Browse files
committed
PR Feedback
1 parent 5596d52 commit c4d10b5

32 files changed

+296
-319
lines changed

docs-exp/auth-types.auth.languagecode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.languageCode property
66

7-
The current Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified.
7+
The Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.auth.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ export interface Auth
2020
| --- | --- | --- |
2121
| [config](./auth-types.auth.config.md) | [Config](./auth-types.config.md) | The [Config](./auth-types.config.md) used to initialize this instance. |
2222
| [currentUser](./auth-types.auth.currentuser.md) | [User](./auth-types.user.md) \| null | The currently signed-in user (or null). |
23-
| [languageCode](./auth-types.auth.languagecode.md) | string \| null | The current Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified. |
23+
| [languageCode](./auth-types.auth.languagecode.md) | string \| null | The Auth instance's language code. This is a readable/writable property. When set to null, the default Firebase Console language setting is applied. The language code will propagate to email action templates (password reset, email verification and email change revocation), SMS templates for phone authentication, reCAPTCHA verifier and OAuth popup/redirect operations provided the specified providers support localization with the language code specified. |
2424
| [name](./auth-types.auth.name.md) | string | The name of the app associated with the Auth service instance. |
25-
| [settings](./auth-types.auth.settings.md) | [AuthSettings](./auth-types.authsettings.md) | The current Auth instance's settings. This is used to edit/read configuration related options like app verification mode for phone authentication. |
26-
| [tenantId](./auth-types.auth.tenantid.md) | string \| null | The current Auth instance's tenant ID. This is a readable/writable property. When you set the tenant ID of an Auth instance, all future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to the specified tenant project. When set to null, users are signed in to the parent project. By default, this is set to null. |
25+
| [settings](./auth-types.auth.settings.md) | [AuthSettings](./auth-types.authsettings.md) | The Auth instance's settings. This is used to edit/read configuration related options like app verification mode for phone authentication. |
26+
| [tenantId](./auth-types.auth.tenantid.md) | string \| null | The Auth instance's tenant ID. This is a readable/writable property. When you set the tenant ID of an Auth instance, all future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to the specified tenant project. When set to null, users are signed in to the parent project. By default, this is set to null. |
2727

2828
## Methods
2929

3030
| Method | Description |
3131
| --- | --- |
32-
| [onAuthStateChanged(nextOrObserver, error, completed)](./auth-types.auth.onauthstatechanged.md) | Adds an observer for changes to the user's sign-in state.<!-- -->Prior to 4.0.0, this triggered the observer when users were signed in, signed out, or when the user's ID token changed in situations such as token expiry or password change. After 4.0.0, the observer is only triggered on sign-in or sign-out.<!-- -->To keep the old behavior, see [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md)<!-- -->. |
33-
| [onIdTokenChanged(nextOrObserver, error, completed)](./auth-types.auth.onidtokenchanged.md) | Adds an observer for changes to the signed-in user's ID token, which includes sign-in, sign-out, and token refresh events. This method has the same behavior as [Auth.onAuthStateChanged()](./auth-types.auth.onauthstatechanged.md) had prior to 4.0.0. |
34-
| [setPersistence(persistence)](./auth-types.auth.setpersistence.md) | Changes the current type of persistence on the current Auth instance for the currently saved Auth session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests.<!-- -->This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the Auth state for applications that are shared by other users or have sensitive data. |
32+
| [onAuthStateChanged(nextOrObserver, error, completed)](./auth-types.auth.onauthstatechanged.md) | Adds an observer for changes to the user's sign-in state.<!-- -->To keep the old behavior, see [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md)<!-- -->. |
33+
| [onIdTokenChanged(nextOrObserver, error, completed)](./auth-types.auth.onidtokenchanged.md) | Adds an observer for changes to the signed-in user's ID token, which includes sign-in, sign-out, and token refresh events. |
34+
| [setPersistence(persistence)](./auth-types.auth.setpersistence.md) | Changes the type of persistence on the Auth instance for the currently saved Auth session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests.<!-- -->This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the Auth state for applications that are shared by other users or have sensitive data. |
3535
| [signOut()](./auth-types.auth.signout.md) | Signs out the current user. |
36-
| [updateCurrentUser(user)](./auth-types.auth.updatecurrentuser.md) | Asynchronously sets the provided user as <code>currentUser</code> on the current Auth instance. A new instance copy of the user provided will be made and set as currentUser.<!-- -->This will trigger [Auth.onAuthStateChanged()](./auth-types.auth.onauthstatechanged.md) and [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md) listeners like other sign in methods.<!-- -->The operation fails with an error if the user to be updated belongs to a different Firebase project. |
36+
| [updateCurrentUser(user)](./auth-types.auth.updatecurrentuser.md) | Asynchronously sets the provided user as <code>currentUser</code> on the Auth instance. A new instance copy of the user provided will be made and set as currentUser.<!-- -->This will trigger [Auth.onAuthStateChanged()](./auth-types.auth.onauthstatechanged.md) and [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md) listeners like other sign in methods.<!-- -->The operation fails with an error if the user to be updated belongs to a different Firebase project. |
3737
| [useDeviceLanguage()](./auth-types.auth.usedevicelanguage.md) | Sets the current language to the default device/browser preference. |
3838
| [useEmulator(url)](./auth-types.auth.useemulator.md) | Modify this Auth instance to communicate with the Firebase Auth emulator. This must be called synchronously immediately following the first call to <code>firebase.auth()</code>. Do not use with production credentials as emulator traffic is not encrypted. |
3939

docs-exp/auth-types.auth.onauthstatechanged.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
Adds an observer for changes to the user's sign-in state.
88

9-
Prior to 4.0.0, this triggered the observer when users were signed in, signed out, or when the user's ID token changed in situations such as token expiry or password change. After 4.0.0, the observer is only triggered on sign-in or sign-out.
10-
119
To keep the old behavior, see [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md)<!-- -->.
1210

1311
<b>Signature:</b>

docs-exp/auth-types.auth.onidtokenchanged.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.onIdTokenChanged() method
66

7-
Adds an observer for changes to the signed-in user's ID token, which includes sign-in, sign-out, and token refresh events. This method has the same behavior as [Auth.onAuthStateChanged()](./auth-types.auth.onauthstatechanged.md) had prior to 4.0.0.
7+
Adds an observer for changes to the signed-in user's ID token, which includes sign-in, sign-out, and token refresh events.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.auth.setpersistence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.setPersistence() method
66

7-
Changes the current type of persistence on the current Auth instance for the currently saved Auth session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests.
7+
Changes the type of persistence on the Auth instance for the currently saved Auth session and applies this type of persistence for future sign-in requests, including sign-in with redirect requests.
88

99
This makes it easy for a user signing in to specify whether their session should be remembered or not. It also makes it easier to never persist the Auth state for applications that are shared by other users or have sensitive data.
1010

docs-exp/auth-types.auth.settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.settings property
66

7-
The current Auth instance's settings. This is used to edit/read configuration related options like app verification mode for phone authentication.
7+
The Auth instance's settings. This is used to edit/read configuration related options like app verification mode for phone authentication.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.auth.tenantid.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.tenantId property
66

7-
The current Auth instance's tenant ID. This is a readable/writable property. When you set the tenant ID of an Auth instance, all future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to the specified tenant project. When set to null, users are signed in to the parent project. By default, this is set to null.
7+
The Auth instance's tenant ID. This is a readable/writable property. When you set the tenant ID of an Auth instance, all future sign-in/sign-up operations will pass this tenant ID and sign in or sign up users to the specified tenant project. When set to null, users are signed in to the parent project. By default, this is set to null.
88

99
<b>Signature:</b>
1010

@@ -17,11 +17,11 @@ tenantId: string | null;
1717

1818
```
1919
// Set the tenant ID on Auth instance.
20-
auth.tenantId = TENANT_PROJECT_ID;
20+
auth.tenantId = 'TENANT_PROJECT_ID';
2121
2222
// All future sign-in request now include tenant ID.
2323
const result = await signInWithEmailAndPassword(auth, email, password);
24-
// result.user.tenantId should be TENANT_PROJECT_ID.
24+
// result.user.tenantId should be 'TENANT_PROJECT_ID'.
2525
2626
```
2727

docs-exp/auth-types.auth.updatecurrentuser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Auth.updateCurrentUser() method
66

7-
Asynchronously sets the provided user as `currentUser` on the current Auth instance. A new instance copy of the user provided will be made and set as currentUser.
7+
Asynchronously sets the provided user as `currentUser` on the Auth instance. A new instance copy of the user provided will be made and set as currentUser.
88

99
This will trigger [Auth.onAuthStateChanged()](./auth-types.auth.onauthstatechanged.md) and [Auth.onIdTokenChanged()](./auth-types.auth.onidtokenchanged.md) listeners like other sign in methods.
1010

docs-exp/auth-types.autherror.email.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## AuthError.email property
66

7-
The email of the user's account used for sign-in/linking.
7+
The email of the user's account, used for sign-in/linking.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.autherror.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AuthError extends FirebaseError
1717
| Property | Type | Description |
1818
| --- | --- | --- |
1919
| [appName](./auth-types.autherror.appname.md) | string | The name of the Firebase App which triggered this error. |
20-
| [email](./auth-types.autherror.email.md) | string | The email of the user's account used for sign-in/linking. |
21-
| [phoneNumber](./auth-types.autherror.phonenumber.md) | string | The phone number of the user's account used for sign-in/linking. |
20+
| [email](./auth-types.autherror.email.md) | string | The email of the user's account, used for sign-in/linking. |
21+
| [phoneNumber](./auth-types.autherror.phonenumber.md) | string | The phone number of the user's account, used for sign-in/linking. |
2222
| [tenantid](./auth-types.autherror.tenantid.md) | string | The tenant ID being used for sign-in/linking. If you use <code>signInWithRedirect</code> to sign in, you have to set the tenant ID on [Auth](./auth-types.auth.md) instance again as the tenant ID is not persisted after redirection. |
2323

docs-exp/auth-types.autherror.phonenumber.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## AuthError.phoneNumber property
66

7-
The phone number of the user's account used for sign-in/linking.
7+
The phone number of the user's account, used for sign-in/linking.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.idtokenresult.issuedattime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## IdTokenResult.issuedAtTime property
66

7-
The ID token issued at time formatted as a UTC string.
7+
The ID token issuance time formatted as a UTC string.
88

99
<b>Signature:</b>
1010

docs-exp/auth-types.idtokenresult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface IdTokenResult
2121
| [authTime](./auth-types.idtokenresult.authtime.md) | string | The authentication time formatted as a UTC string. This is the time the user authenticated (signed in) and not the time the token was refreshed. |
2222
| [claims](./auth-types.idtokenresult.claims.md) | [ParsedToken](./auth-types.parsedtoken.md) | The entire payload claims of the ID token including the standard reserved claims as well as the custom claims. |
2323
| [expirationTime](./auth-types.idtokenresult.expirationtime.md) | string | The ID token expiration time formatted as a UTC string. |
24-
| [issuedAtTime](./auth-types.idtokenresult.issuedattime.md) | string | The ID token issued at time formatted as a UTC string. |
24+
| [issuedAtTime](./auth-types.idtokenresult.issuedattime.md) | string | The ID token issuance time formatted as a UTC string. |
2525
| [signInProvider](./auth-types.idtokenresult.signinprovider.md) | string \| null | The sign-in provider through which the ID token was obtained (anonymous, custom, phone, password, etc). Note, this does not map to provider IDs. |
2626
| [signInSecondFactor](./auth-types.idtokenresult.signinsecondfactor.md) | string \| null | The type of second factor associated with this session, provided the user was multi-factor authenticated (eg. phone, etc). |
2727
| [token](./auth-types.idtokenresult.token.md) | string | The Firebase Auth ID token JWT string. |

docs-exp/auth-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
| [PopupRedirectResolver](./auth-types.popupredirectresolver.md) | A resolver used for handling DOM specific operations like <code>signInWithPopup()</code> or <code>signInWithRedirect()</code> |
5757
| [ReactNativeAsyncStorage](./auth-types.reactnativeasyncstorage.md) | |
5858
| [User](./auth-types.user.md) | A user account. |
59-
| [UserCredential](./auth-types.usercredential.md) | A structure containing a User, an AuthCredential, the <code>operationType</code>, and any additional user information that was returned from the identity provider. operationType could be [OperationType.SIGN\_IN](./auth-types.operationtype.sign_in.md) for a sign-in operation, [OperationType.LINK](./auth-types.operationtype.link.md) for a linking operation and [OperationType.REAUTHENTICATE](./auth-types.operationtype.reauthenticate.md) for a reauthentication operation. |
59+
| [UserCredential](./auth-types.usercredential.md) | A structure containing a User, an AuthCredential, the <code>operationType</code>, and any additional user information that was returned from the identity provider. <code>operationType</code> could be [OperationType.SIGN\_IN](./auth-types.operationtype.sign_in.md) for a sign-in operation, [OperationType.LINK](./auth-types.operationtype.link.md) for a linking operation and [OperationType.REAUTHENTICATE](./auth-types.operationtype.reauthenticate.md) for a reauthentication operation. |
6060
| [UserInfo](./auth-types.userinfo.md) | User profile information, visible only to the Firebase project's apps. |
6161
| [UserMetadata](./auth-types.usermetadata.md) | Interface representing a user's metadata. |
6262

docs-exp/auth-types.multifactorerror.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ signInWithEmailAndPassword(auth, email, password)
3333
}
3434
});
3535

36-
resolver.resolveSignIn(multiFactorAssertion)
37-
.then(function(userCredential) {
38-
// User signed in.
39-
});
36+
const userCredential = await resolver.resolveSignIn(multiFactorAssertion);
37+
// User signed in.
4038

4139
```
4240

docs-exp/auth-types.multifactorresolver.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,21 @@ signInWithEmailAndPassword(auth, email, password)
4040
// UI needs to be presented to allow the user to select a second factor
4141
// from that list.
4242

43-
var selectedHint = // ; selected from multiFactorHints
44-
var phoneAuthProvider = new PhoneAuthProvider();
45-
var phoneInfoOptions = {
43+
const selectedHint = // ; selected from multiFactorHints
44+
const phoneAuthProvider = new PhoneAuthProvider();
45+
const phoneInfoOptions = {
4646
multiFactorHint: selectedHint,
4747
session: resolver.session
4848
};
49-
phoneAuthProvider.verifyPhoneNumber(
50-
phoneInfoOptions,
51-
appVerifier
52-
).then((verificationId) => {
53-
// store verificationID and show UI to let user enter verification code.
54-
});
49+
const verificationId = phoneAuthProvider.verifyPhoneNumber(phoneInfoOptions, appVerifier);
50+
// store verificationID and show UI to let user enter verification code.
5551

5652
// UI to enter verification code and continue.
5753
// Continue button click handler
58-
var phoneAuthCredential =
59-
PhoneAuthProvider.credential(verificationId, verificationCode);
60-
var multiFactorAssertion =
61-
PhoneMultiFactorGenerator.assertion(phoneAuthCredential);
62-
resolver.resolveSignIn(multiFactorAssertion)
63-
.then((userCredential) => {
64-
// User signed in.
65-
});
54+
const phoneAuthCredential = PhoneAuthProvider.credential(verificationId, verificationCode);
55+
const multiFactorAssertion = PhoneMultiFactorGenerator.assertion(phoneAuthCredential);
56+
const userCredential = await resolver.resolveSignIn(multiFactorAssertion);
57+
// User signed in.
6658

6759
```
6860

docs-exp/auth-types.multifactoruser.enroll.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## MultiFactorUser.enroll() method
66

7-
Enrolls a second factor as identified by the [MultiFactorAssertion](./auth-types.multifactorassertion.md) for the current user. On resolution, the user tokens are updated to reflect the change in the JWT payload. Accepts an additional display name parameter used to identify the second factor to the end user. Recent re-authentication is required for this operation to succeed. On successful enrollment, existing Firebase sessions (refresh tokens) are revoked. When a new factor is enrolled, an email notification is sent to the user’s email.
7+
Enrolls a second factor as identified by the [MultiFactorAssertion](./auth-types.multifactorassertion.md) for the user. On resolution, the user tokens are updated to reflect the change in the JWT payload. Accepts an additional display name parameter used to identify the second factor to the end user. Recent re-authentication is required for this operation to succeed. On successful enrollment, existing Firebase sessions (refresh tokens) are revoked. When a new factor is enrolled, an email notification is sent to the user’s email.
88

99
<b>Signature:</b>
1010

@@ -30,7 +30,7 @@ Promise&lt;void&gt;
3030

3131

3232
```
33-
const multiFactorUser = multiFactor(firebase.auth().currentUser);
33+
const multiFactorUser = multiFactor(auth.currentUser);
3434
const multiFactorSession = await multiFactorUser.getSession();
3535
// Send verification code
3636
const phoneAuthProvider = new PhoneAuthProvider();

docs-exp/auth-types.multifactoruser.getsession.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## MultiFactorUser.getSession() method
66

7-
Returns the session identifier for a second factor enrollment operation. This is used to identify the current user trying to enroll a second factor.
7+
Returns the session identifier for a second factor enrollment operation. This is used to identify the user trying to enroll a second factor.
88

99
<b>Signature:</b>
1010

0 commit comments

Comments
 (0)