-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(@aws-amplify/auth): incorrect return type for Auth.resendSignUp #5112
fix(@aws-amplify/auth): incorrect return type for Auth.resendSignUp #5112
Conversation
Codecov Report
@@ Coverage Diff @@
## main #5112 +/- ##
==========================================
- Coverage 73.48% 73.31% -0.18%
==========================================
Files 205 208 +3
Lines 12621 12922 +301
Branches 2460 2526 +66
==========================================
+ Hits 9275 9474 +199
- Misses 3157 3257 +100
- Partials 189 191 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Thanks for this.
We still need to validate the PR, but I had a question about Promise<any>
first. 🤞
*/ | ||
public resendSignUp( | ||
username: string, | ||
clientMetadata: ClientMetaData = this._config.clientMetadata | ||
): Promise<string> { | ||
): Promise<any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It possible to re-use CodeDeliveryDetails
here?
amplify-js/packages/amazon-cognito-identity-js/index.d.ts
Lines 6 to 10 in ac34816
export interface CodeDeliveryDetails { | |
AttributeName: string; | |
DeliveryMedium: string; | |
Destination: string; | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ericclemmons are we sure it always resolves to CodeDeliveryDetails
? I wasn't positive so I chose any
. The code builds fine with CodeDelieryDetails
in there and I can push that if you'd like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The branch with CodeDeliveryDetails
is here:
https://github.com/mousedownmike/amplify-js/tree/resendsignup_codedeliverydetails
Happy to close this PR and start a new one or merge the change into this one. Whichever solution works best and whenever it works.
Cheers,
Mike
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to get this merged in once tests pass.
We'll do some more tests to confirm the payload shape, but for now this is a great step forward 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I went ahead & opened #6561 for comparison)
Everything looks good, though we'll need to manually validate the response payload against the types to be sure whether The underlying call indicates a amplify-js/packages/amazon-cognito-identity-js/src/CognitoUser.js Lines 1280 to 1286 in ac34816
|
Exactly what we added to our project to resolve this mistype of the return type. |
*/ | ||
public resendSignUp( | ||
username: string, | ||
clientMetadata: ClientMetaData = this._config.clientMetadata | ||
): Promise<string> { | ||
): Promise<any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to get this merged in once tests pass.
We'll do some more tests to confirm the payload shape, but for now this is a great step forward 👍
…ws-amplify#5112) Co-authored-by: Eric Clemmons <[email protected]>
…5112) Co-authored-by: Eric Clemmons <[email protected]>
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Partial fix for #5029
Updated
Auth.resendSignUp
signature to returnany
type instead ofstring
. Revised Spy to be reflective of an actualCodeDeliveryDetails
response.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.