Skip to content
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

CompleteNewPassword requiredAttributes is not optional #6634

Closed
joeltio opened this issue Aug 24, 2020 · 2 comments · Fixed by #6657
Closed

CompleteNewPassword requiredAttributes is not optional #6634

joeltio opened this issue Aug 24, 2020 · 2 comments · Fixed by #6657
Labels
Auth Related to Auth components/category bug Something isn't working TypeScript Related to TypeScript issues

Comments

@joeltio
Copy link
Contributor

joeltio commented Aug 24, 2020

Describe the bug
The Auth.completeNewPassword should only require two arguments: user and password but the types do not reflect so. The signature of the function is:

completeNewPassword(user: CognitoUser | any, password: string, requiredAttributes: any, clientMetadata?: ClientMetaData): Promise<CognitoUser | any>

Notice how requiredAttributes is not optional. However, the docs say that it is optional.

To Reproduce
Steps to reproduce the behavior:

  1. Create a typescript-enabled project
  2. Import the Auth package
  3. Type Auth.completeNewPassword('', '')
  4. See error

Expected behavior
There should not be an error reported by typescript.

Code Snippet

import Auth from '@aws-amplify/auth';
Auth.completeNewPassword('', '');
@joeltio joeltio added the to-be-reproduced Used in order for Amplify to reproduce said issue label Aug 24, 2020
@amhinson amhinson added the Auth Related to Auth components/category label Aug 24, 2020
@sammartinez sammartinez added the TypeScript Related to TypeScript issues label Aug 25, 2020
@elorzafe elorzafe added bug Something isn't working and removed to-be-reproduced Used in order for Amplify to reproduce said issue labels Aug 25, 2020
@elorzafe
Copy link
Contributor

Thanks @joeltio I will send a PR to fix this

@github-actions
Copy link

This issue 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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Auth Related to Auth components/category bug Something isn't working TypeScript Related to TypeScript issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants