Skip to content

Commit 4aef354

Browse files
committed
Auth docs
1 parent 8939cd4 commit 4aef354

21 files changed

+70
-70
lines changed

common/api-review/auth-types-exp.api.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ export interface ActionCodeInfo {
1818
multiFactorInfo?: MultiFactorInfo | null;
1919
previousEmail?: string | null;
2020
};
21-
operation: Operation;
21+
operation: ActionCodeOperation;
22+
}
23+
24+
// @public
25+
export const enum ActionCodeOperation {
26+
EMAIL_SIGNIN = 'EMAIL_SIGNIN',
27+
PASSWORD_RESET = 'PASSWORD_RESET',
28+
RECOVER_EMAIL = 'RECOVER_EMAIL',
29+
REVERT_SECOND_FACTOR_ADDITION = 'REVERT_SECOND_FACTOR_ADDITION',
30+
VERIFY_AND_CHANGE_EMAIL = 'VERIFY_AND_CHANGE_EMAIL',
31+
VERIFY_EMAIL = 'VERIFY_EMAIL'
2232
}
2333

2434
// @public
@@ -42,15 +52,15 @@ export abstract class ActionCodeURL {
4252
readonly code: string;
4353
readonly continueUrl: string | null;
4454
readonly languageCode: string | null;
45-
readonly operation: Operation;
55+
readonly operation: ActionCodeOperation;
4656
static parseLink(link: string): ActionCodeURL | null;
4757
readonly tenantId: string | null;
4858
}
4959

5060
// @public
5161
export interface AdditionalUserInfo {
5262
readonly isNewUser: boolean;
53-
readonly profile: UserProfile | null;
63+
readonly profile: Record<string, unknown> | null;
5464
readonly providerId: ProviderId | null;
5565
readonly username?: string | null;
5666
}
@@ -148,6 +158,11 @@ export abstract class EmailAuthProvider implements AuthProvider {
148158
readonly providerId: ProviderId;
149159
}
150160

161+
// @public
162+
export const enum FactorId {
163+
PHONE = 'phone',
164+
}
165+
151166
// @public
152167
export interface IdTokenResult {
153168
authTime: string;
@@ -161,20 +176,19 @@ export interface IdTokenResult {
161176

162177
// @public
163178
export interface MultiFactorAssertion {
164-
readonly factorId: string;
179+
readonly factorId: FactorId;
165180
}
166181

167182
// @public
168183
export interface MultiFactorError extends AuthError {
169-
readonly credential: AuthCredential;
170184
readonly operationType: OperationType;
171185
}
172186

173187
// @public
174188
export interface MultiFactorInfo {
175189
readonly displayName?: string | null;
176190
readonly enrollmentTime: string;
177-
readonly factorId: ProviderId;
191+
readonly factorId: FactorId;
178192
readonly uid: string;
179193
}
180194

@@ -213,16 +227,6 @@ export abstract class OAuthCredential extends AuthCredential {
213227
readonly secret?: string;
214228
}
215229

216-
// @public
217-
export const enum Operation {
218-
EMAIL_SIGNIN = 'EMAIL_SIGNIN',
219-
PASSWORD_RESET = 'PASSWORD_RESET',
220-
RECOVER_EMAIL = 'RECOVER_EMAIL',
221-
REVERT_SECOND_FACTOR_ADDITION = 'REVERT_SECOND_FACTOR_ADDITION',
222-
VERIFY_AND_CHANGE_EMAIL = 'VERIFY_AND_CHANGE_EMAIL',
223-
VERIFY_EMAIL = 'VERIFY_EMAIL'
224-
}
225-
226230
// @public
227231
export const enum OperationType {
228232
LINK = 'link',
@@ -410,9 +414,6 @@ export interface UserMetadata {
410414
readonly lastSignInTime?: string;
411415
}
412416

413-
// @public
414-
export type UserProfile = Record<string, unknown>;
415-
416417

417418
// (No @packageDocumentation comment for this package)
418419

docs-exp/auth-types.actioncodeinfo.data.md

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

55
## ActionCodeInfo.data property
66

7-
The data associated with the action code.
7+
The data associated with the action code. For the , , and actions, this object contains an email field with the address the email was sent to.
8+
9+
For the action, which allows a user to undo an email address change, this object also contains a `previousEmail` field with the user account's current email address. After the action completes, the user's email address will revert to the value in the `email` field from the value in `previousEmail` field.
10+
11+
For the action, which allows a user to verify the email before updating it, this object contains a `previousEmail` field with the user account's email address before updating. After the action completes, the user's email address will be updated to the value in the `email` field from the value in `previousEmail` field.
12+
13+
For the action, which allows a user to unenroll a newly added second factor, this object contains a `multiFactorInfo` field with the information about the second factor. For phone second factor, the `multiFactorInfo` is a [MultiFactorInfo](./auth-types.multifactorinfo.md) object, which contains the phone number.
814

915
<b>Signature:</b>
1016

docs-exp/auth-types.actioncodeinfo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ export interface ActionCodeInfo
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [data](./auth-types.actioncodeinfo.data.md) | { email?: string \| null; multiFactorInfo?: [MultiFactorInfo](./auth-types.multifactorinfo.md) \| null; previousEmail?: string \| null; } | The data associated with the action code. |
20-
| [operation](./auth-types.actioncodeinfo.operation.md) | [Operation](./auth-types.operation.md) | The type of operation that generated the action code. |
19+
| [data](./auth-types.actioncodeinfo.data.md) | { email?: string \| null; multiFactorInfo?: [MultiFactorInfo](./auth-types.multifactorinfo.md) \| null; previousEmail?: string \| null; } | The data associated with the action code. For the , , and actions, this object contains an email field with the address the email was sent to.<!-- -->For the action, which allows a user to undo an email address change, this object also contains a <code>previousEmail</code> field with the user account's current email address. After the action completes, the user's email address will revert to the value in the <code>email</code> field from the value in <code>previousEmail</code> field.<!-- -->For the action, which allows a user to verify the email before updating it, this object contains a <code>previousEmail</code> field with the user account's email address before updating. After the action completes, the user's email address will be updated to the value in the <code>email</code> field from the value in <code>previousEmail</code> field.<!-- -->For the action, which allows a user to unenroll a newly added second factor, this object contains a <code>multiFactorInfo</code> field with the information about the second factor. For phone second factor, the <code>multiFactorInfo</code> is a [MultiFactorInfo](./auth-types.multifactorinfo.md) object, which contains the phone number. |
20+
| [operation](./auth-types.actioncodeinfo.operation.md) | [ActionCodeOperation](./auth-types.actioncodeoperation.md) | The type of operation that generated the action code. |
2121

docs-exp/auth-types.actioncodeinfo.operation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ The type of operation that generated the action code.
99
<b>Signature:</b>
1010

1111
```typescript
12-
operation: Operation;
12+
operation: ActionCodeOperation;
1313
```

docs-exp/auth-types.operation.md renamed to docs-exp/auth-types.actioncodeoperation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
22

3-
[Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [Operation](./auth-types.operation.md)
3+
[Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [ActionCodeOperation](./auth-types.actioncodeoperation.md)
44

5-
## Operation enum
5+
## ActionCodeOperation enum
66

77
An enumeration of the possible email action types.
88

99
<b>Signature:</b>
1010

1111
```typescript
12-
export const enum Operation
12+
export const enum ActionCodeOperation
1313
```
1414

1515
## Enumeration Members

docs-exp/auth-types.actioncodeurl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export abstract class ActionCodeURL
2020
| [code](./auth-types.actioncodeurl.code.md) | | string | The action code of the email action link. |
2121
| [continueUrl](./auth-types.actioncodeurl.continueurl.md) | | string \| null | The continue URL of the email action link. Null if not provided. |
2222
| [languageCode](./auth-types.actioncodeurl.languagecode.md) | | string \| null | The language code of the email action link. Null if not provided. |
23-
| [operation](./auth-types.actioncodeurl.operation.md) | | [Operation](./auth-types.operation.md) | The action performed by the email action link. It returns from one of the types from [ActionCodeInfo](./auth-types.actioncodeinfo.md) |
23+
| [operation](./auth-types.actioncodeurl.operation.md) | | [ActionCodeOperation](./auth-types.actioncodeoperation.md) | The action performed by the email action link. It returns from one of the types from [ActionCodeInfo](./auth-types.actioncodeinfo.md) |
2424
| [tenantId](./auth-types.actioncodeurl.tenantid.md) | | string \| null | The tenant ID of the email action link. Null if the email action is from the parent project. |
2525

2626
## Methods

docs-exp/auth-types.actioncodeurl.operation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ The action performed by the email action link. It returns from one of the types
99
<b>Signature:</b>
1010

1111
```typescript
12-
readonly operation: Operation;
12+
readonly operation: ActionCodeOperation;
1313
```

docs-exp/auth-types.additionaluserinfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AdditionalUserInfo
1717
| Property | Type | Description |
1818
| --- | --- | --- |
1919
| [isNewUser](./auth-types.additionaluserinfo.isnewuser.md) | boolean | Whether the user is new (created via sign-up) or existing (authenticated using sign-in). |
20-
| [profile](./auth-types.additionaluserinfo.profile.md) | [UserProfile](./auth-types.userprofile.md) \| null | Map containing IDP-specific user data. |
20+
| [profile](./auth-types.additionaluserinfo.profile.md) | Record&lt;string, unknown&gt; \| null | Map containing IDP-specific user data. |
2121
| [providerId](./auth-types.additionaluserinfo.providerid.md) | [ProviderId](./auth-types.providerid.md) \| null | Identifier for the provider used to authenticate this user. |
2222
| [username](./auth-types.additionaluserinfo.username.md) | string \| null | The username if the provider is GitHub or Twitter. |
2323

docs-exp/auth-types.additionaluserinfo.profile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Map containing IDP-specific user data.
99
<b>Signature:</b>
1010

1111
```typescript
12-
readonly profile: UserProfile | null;
12+
readonly profile: Record<string, unknown> | null;
1313
```

docs-exp/auth-types.factorid.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [@firebase/auth-types](./auth-types.md) &gt; [FactorId](./auth-types.factorid.md)
4+
5+
## FactorId enum
6+
7+
An enum of factors that may be used for multifactor authentication.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
export const enum FactorId
13+
```
14+
15+
## Enumeration Members
16+
17+
| Member | Value | Description |
18+
| --- | --- | --- |
19+
| PHONE | <code>'phone'</code> | Phone as second factor |
20+

docs-exp/auth-types.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@
2222

2323
| Enumeration | Description |
2424
| --- | --- |
25-
| [Operation](./auth-types.operation.md) | An enumeration of the possible email action types. |
26-
| [OperationType](./auth-types.operationtype.md) | Enumeration of supported operation types. |
27-
| [ProviderId](./auth-types.providerid.md) | Enumeration of supported providers. |
28-
| [SignInMethod](./auth-types.signinmethod.md) | Enumeration of supported sign-in methods. |
25+
| [ActionCodeOperation](./auth-types.actioncodeoperation.md) | An enumeration of the possible email action types. |
26+
| [FactorId](./auth-types.factorid.md) | An enum of factors that may be used for multifactor authentication. |
27+
| [OperationType](./auth-types.operationtype.md) | Supported operation types. |
28+
| [ProviderId](./auth-types.providerid.md) | Supported providers. |
29+
| [SignInMethod](./auth-types.signinmethod.md) | Supported sign-in methods. |
2930

3031
## Interfaces
3132

@@ -71,6 +72,5 @@ When initializing Auth, is default. |
7172
| Type Alias | Description |
7273
| --- | --- |
7374
| [NextOrObserver](./auth-types.nextorobserver.md) | Type definition for an event callback. |
74-
| [PhoneInfoOptions](./auth-types.phoneinfooptions.md) | The information required to verify the ownership of a phone number. |
75-
| [UserProfile](./auth-types.userprofile.md) | User profile used in [AdditionalUserInfo](./auth-types.additionaluserinfo.md)<!-- -->. |
75+
| [PhoneInfoOptions](./auth-types.phoneinfooptions.md) | The information required to verify the ownership of a phone number. The information that's required depends on whether you are doing single-factor sign-in, multi-factor enrollment or multi-factor sign-in. |
7676

docs-exp/auth-types.multifactorassertion.factorid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ The identifier of the second factor.
99
<b>Signature:</b>
1010

1111
```typescript
12-
readonly factorId: string;
12+
readonly factorId: FactorId;
1313
```

docs-exp/auth-types.multifactorassertion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ This is used to facilitate enrollment of a second factor on an existing user or
2020

2121
| Property | Type | Description |
2222
| --- | --- | --- |
23-
| [factorId](./auth-types.multifactorassertion.factorid.md) | string | The identifier of the second factor. |
23+
| [factorId](./auth-types.multifactorassertion.factorid.md) | [FactorId](./auth-types.factorid.md) | The identifier of the second factor. |
2424

docs-exp/auth-types.multifactorerror.credential.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs-exp/auth-types.multifactorerror.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,5 @@ const userCredential = await resolver.resolveSignIn(multiFactorAssertion);
4747
4848
| Property | Type | Description |
4949
| --- | --- | --- |
50-
| [credential](./auth-types.multifactorerror.credential.md) | [AuthCredential](./auth-types.authcredential.md) | The original credential used as a first factor. |
5150
| [operationType](./auth-types.multifactorerror.operationtype.md) | [OperationType](./auth-types.operationtype.md) | The type of operation (e.g., sign-in, link, or reauthenticate) during which the error was raised. |
5251

docs-exp/auth-types.multifactorinfo.factorid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ The identifier of the second factor.
99
<b>Signature:</b>
1010

1111
```typescript
12-
readonly factorId: ProviderId;
12+
readonly factorId: FactorId;
1313
```

docs-exp/auth-types.multifactorinfo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ export interface MultiFactorInfo
1818
| --- | --- | --- |
1919
| [displayName](./auth-types.multifactorinfo.displayname.md) | string \| null | The user friendly name of the current second factor. |
2020
| [enrollmentTime](./auth-types.multifactorinfo.enrollmenttime.md) | string | The enrollment date of the second factor formatted as a UTC string. |
21-
| [factorId](./auth-types.multifactorinfo.factorid.md) | [ProviderId](./auth-types.providerid.md) | The identifier of the second factor. |
21+
| [factorId](./auth-types.multifactorinfo.factorid.md) | [FactorId](./auth-types.factorid.md) | The identifier of the second factor. |
2222
| [uid](./auth-types.multifactorinfo.uid.md) | string | The multi-factor enrollment ID. |
2323

docs-exp/auth-types.userprofile.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs-exp/auth.actioncodeurl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export declare class ActionCodeURL implements externs.ActionCodeURL
2121
| [code](./auth.actioncodeurl.code.md) | | string | The action code of the email action link. |
2222
| [continueUrl](./auth.actioncodeurl.continueurl.md) | | string \| null | The continue URL of the email action link. Null if not provided. |
2323
| [languageCode](./auth.actioncodeurl.languagecode.md) | | string \| null | The language code of the email action link. Null if not provided. |
24-
| [operation](./auth.actioncodeurl.operation.md) | | externs.[Operation](./auth-types.operation.md) | The action performed by the email action link. It returns from one of the types from [ActionCodeInfo](./auth-types.actioncodeinfo.md) |
24+
| [operation](./auth.actioncodeurl.operation.md) | | externs.[ActionCodeOperation](./auth-types.actioncodeoperation.md) | The action performed by the email action link. It returns from one of the types from |
2525
| [tenantId](./auth.actioncodeurl.tenantid.md) | | string \| null | The tenant ID of the email action link. Null if the email action is from the parent project. |
2626
2727
## Methods

docs-exp/auth.actioncodeurl.operation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ The action performed by the email action link. It returns from one of the types
99
<b>Signature:</b>
1010

1111
```typescript
12-
readonly operation: externs.Operation;
12+
readonly operation: externs.ActionCodeOperation;
1313
```

docs-exp/auth.oauthprovider.credential.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ credential(params: OAuthCredentialOptions): externs.OAuthCredential;
1616

1717
| Parameter | Type | Description |
1818
| --- | --- | --- |
19-
| params | [OAuthCredentialOptions](./auth.oauthcredentialoptions.md) | Either the options object containing the ID token, access token and raw nonce or the ID token string. |
19+
| params | OAuthCredentialOptions | |
2020

2121
<b>Returns:</b>
2222

0 commit comments

Comments
 (0)