Skip to content

Commit c4af08e

Browse files
committed
Auth docs
1 parent 66a08d2 commit c4af08e

25 files changed

+64
-114
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
}
@@ -145,6 +155,11 @@ export abstract class EmailAuthProvider implements AuthProvider {
145155
readonly providerId: ProviderId;
146156
}
147157

158+
// @public
159+
export const enum FactorId {
160+
PHONE = 'phone',
161+
}
162+
148163
// @public
149164
export interface IdTokenResult {
150165
authTime: string;
@@ -158,20 +173,19 @@ export interface IdTokenResult {
158173

159174
// @public
160175
export interface MultiFactorAssertion {
161-
readonly factorId: string;
176+
readonly factorId: FactorId;
162177
}
163178

164179
// @public
165180
export interface MultiFactorError extends AuthError {
166-
readonly credential: AuthCredential;
167181
readonly operationType: OperationType;
168182
}
169183

170184
// @public
171185
export interface MultiFactorInfo {
172186
readonly displayName?: string | null;
173187
readonly enrollmentTime: string;
174-
readonly factorId: ProviderId;
188+
readonly factorId: FactorId;
175189
readonly uid: string;
176190
}
177191

@@ -210,16 +224,6 @@ export abstract class OAuthCredential extends AuthCredential {
210224
readonly secret?: string;
211225
}
212226

213-
// @public
214-
export const enum Operation {
215-
EMAIL_SIGNIN = 'EMAIL_SIGNIN',
216-
PASSWORD_RESET = 'PASSWORD_RESET',
217-
RECOVER_EMAIL = 'RECOVER_EMAIL',
218-
REVERT_SECOND_FACTOR_ADDITION = 'REVERT_SECOND_FACTOR_ADDITION',
219-
VERIFY_AND_CHANGE_EMAIL = 'VERIFY_AND_CHANGE_EMAIL',
220-
VERIFY_EMAIL = 'VERIFY_EMAIL'
221-
}
222-
223227
// @public
224228
export const enum OperationType {
225229
LINK = 'link',
@@ -404,9 +408,6 @@ export interface UserMetadata {
404408
readonly lastSignInTime?: string;
405409
}
406410

407-
// @public
408-
export type UserProfile = Record<string, unknown>;
409-
410411

411412
// (No @packageDocumentation comment for this package)
412413

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

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

55
## ActionCodeInfo.data property
66

7-
The data associated with the action code. For the [Operation.PASSWORD\_RESET](./auth-types.operation.password_reset.md)<!-- -->, [Operation.VERIFY\_EMAIL](./auth-types.operation.verify_email.md)<!-- -->, and [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) actions, this object contains an email field with the address the email was sent to.
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.
88

9-
For the [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) 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.
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.
1010

11-
For the [Operation.VERIFY\_AND\_CHANGE\_EMAIL](./auth-types.operation.verify_and_change_email.md) 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.
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.
1212

13-
For the [Operation.REVERT\_SECOND\_FACTOR\_ADDITION](./auth-types.operation.revert_second_factor_addition.md) 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.
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.
1414

1515
<b>Signature:</b>
1616

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. For the [Operation.PASSWORD\_RESET](./auth-types.operation.password_reset.md)<!-- -->, [Operation.VERIFY\_EMAIL](./auth-types.operation.verify_email.md)<!-- -->, and [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) actions, this object contains an email field with the address the email was sent to.<!-- -->For the [Operation.RECOVER\_EMAIL](./auth-types.operation.recover_email.md) 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 [Operation.VERIFY\_AND\_CHANGE\_EMAIL](./auth-types.operation.verify_and_change_email.md) 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 [Operation.REVERT\_SECOND\_FACTOR\_ADDITION](./auth-types.operation.revert_second_factor_addition.md) 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) | [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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
| Enumeration | Description |
2424
| --- | --- |
25-
| [Operation](./auth-types.operation.md) | An enumeration of the possible email action types. |
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. |
2627
| [OperationType](./auth-types.operationtype.md) | Supported operation types. |
2728
| [ProviderId](./auth-types.providerid.md) | Supported providers. |
2829
| [SignInMethod](./auth-types.signinmethod.md) | Supported sign-in methods. |
@@ -66,5 +67,4 @@
6667
| --- | --- |
6768
| [NextOrObserver](./auth-types.nextorobserver.md) | Type definition for an event callback. |
6869
| [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. |
69-
| [UserProfile](./auth-types.userprofile.md) | User profile used in [AdditionalUserInfo](./auth-types.additionaluserinfo.md)<!-- -->. |
7070

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
@@ -16,5 +16,5 @@ export interface MultiFactorAssertion
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [factorId](./auth-types.multifactorassertion.factorid.md) | string | The identifier of the second factor. |
19+
| [factorId](./auth-types.multifactorassertion.factorid.md) | [FactorId](./auth-types.factorid.md) | The identifier of the second factor. |
2020

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
@@ -43,6 +43,5 @@ const userCredential = await resolver.resolveSignIn(multiFactorAssertion);
4343
4444
| Property | Type | Description |
4545
| --- | --- | --- |
46-
| [credential](./auth-types.multifactorerror.credential.md) | [AuthCredential](./auth-types.authcredential.md) | The original credential used as a first factor. |
4746
| [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. |
4847

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 |
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.facebookauthprovider.providerid.md

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

docs-exp/auth.githubauthprovider.providerid.md

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

docs-exp/auth.googleauthprovider.providerid.md

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

docs-exp/auth.oauthprovider.credential.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<b>Signature:</b>
88

99
```typescript
10-
credential(params: CredentialParameters): externs.OAuthCredential;
10+
credential(params: OAuthCredentialOptions): externs.OAuthCredential;
1111
```
1212

1313
## Parameters
1414

1515
| Parameter | Type | Description |
1616
| --- | --- | --- |
17-
| params | CredentialParameters | |
17+
| params | OAuthCredentialOptions | |
1818

1919
<b>Returns:</b>
2020

docs-exp/auth.twitterauthprovider.providerid.md

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

0 commit comments

Comments
 (0)