-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve
mfa.enroll
return types (#956)
## What kind of change does this PR introduce? Bug fix for the TypeScript types. ## What is the current behavior? - Fixes #955 ## What is the new behavior? Use [TypeScript's function overloading](https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads) to return - TOTP data when `mfa.enroll` was passed `factorType: 'totp'`, - phone data when `mfa.enroll` was passed `factorType: 'phone'`. This fixes a breaking change in the types in b957c30. ## Additional context This PR would also expose the new following types: - `MFAEnrollTOTPParams` - `MFAEnrollPhoneParams` - `AuthMFAEnrollTOTPResponse` - `AuthMFAEnrollPhoneResponse` - `AuthMFAEnrollErrorResponse` (it might be better to roll this type in with the other two). It might be better to keep these types private, since once they're exposed, you can't easily remove them again without creating a breaking change.
- Loading branch information
1 parent
96c7f09
commit 8a1ec06
Showing
3 changed files
with
97 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters