Skip to content

Commit

Permalink
Fix ToTP typings issue (#7179)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsubox76 committed Mar 31, 2023
1 parent 8c9f8c8 commit bd51cec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-zoos-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@firebase/auth': patch
---

Fix typings for `TotpMultiFactorGenerator`. This fixes a reversion in 9.19.0.
3 changes: 1 addition & 2 deletions common/api-review/auth.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,7 @@ export interface TotpMultiFactorAssertion extends MultiFactorAssertion {
export class TotpMultiFactorGenerator {
static assertionForEnrollment(secret: TotpSecret, oneTimePassword: string): TotpMultiFactorAssertion;
static assertionForSignIn(enrollmentId: string, oneTimePassword: string): TotpMultiFactorAssertion;
// Warning: (ae-forgotten-export) The symbol "FactorId" needs to be exported by the entry point index.d.ts
static FACTOR_ID: FactorId_2;
static FACTOR_ID: "totp";
static generateSecret(session: MultiFactorSession): Promise<TotpSecret>;
}

Expand Down
4 changes: 2 additions & 2 deletions docs-devsite/auth.totpmultifactorgenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export declare class TotpMultiFactorGenerator

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [FACTOR\_ID](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorfactor_id) | <code>static</code> | FactorId | The identifier of the TOTP second factor: <code>totp</code>. |
| [FACTOR\_ID](./auth.totpmultifactorgenerator.md#totpmultifactorgeneratorfactor_id) | <code>static</code> | 'totp' | The identifier of the TOTP second factor: <code>totp</code>. |

## Methods

Expand All @@ -39,7 +39,7 @@ The identifier of the TOTP second factor: `totp`<!-- -->.
<b>Signature:</b>

```typescript
static FACTOR_ID: FactorId;
static FACTOR_ID: 'totp';
```

## TotpMultiFactorGenerator.assertionForEnrollment()
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/mfa/assertions/totp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class TotpMultiFactorGenerator {
/**
* The identifier of the TOTP second factor: `totp`.
*/
static FACTOR_ID = FactorId.TOTP;
static FACTOR_ID: 'totp' = FactorId.TOTP;
}

export class TotpMultiFactorAssertionImpl
Expand Down

0 comments on commit bd51cec

Please sign in to comment.