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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug Report: Appwrite Rest endpoint expects 'passwordAgain' param when calling account.updateRecovery #92

Open
2 tasks done
clnmcgrw opened this issue Apr 2, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@clnmcgrw
Copy link

clnmcgrw commented Apr 2, 2024

馃憻 Reproduction steps

Install appwrite web sdk, configure w/ v1 endpoint (https://cloud.appwrite.io/v1), and attempt to call account.updateRecovery. The method accepts 3 args (userId, secret, and password), but the endpoint is expecting a separate "passwordAgain" param.
Also, docs still show that the method accepts a 4th "paswordAgain" arg, but in v14.0.0 of sdk it does not support that argument.

馃憤 Expected behavior

I'm able to use the updateRecovery method to confirm password reset by passing 3 arguments - userId, secret, and password.

馃憥 Actual Behavior

I get an error saying that "passwordAgain" param is required, but updateRecovery method does not support it.

馃幉 Appwrite version

Different version (specify in environment)

馃捇 Operating system

MacOS

馃П Your Environment

Local environment, node 20.5.1, appwrite 14.0.0 configured with v1 endpoint

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@clnmcgrw clnmcgrw added the bug Something isn't working label Apr 2, 2024
@dorji-dev
Copy link

dorji-dev commented Apr 3, 2024

@clnmcgrw Faced same issue, looks like there is a mismatch between actual implementation and the latest package code. Had to downgrade the version to 13 for the time being where the updateRecovery method actually supports the passwordAgain argument and is working currently.

@clnmcgrw
Copy link
Author

clnmcgrw commented Apr 6, 2024

In case anyone else runs into this or a similar api/sdk mismatch - you can always just use the client instance to hit the rest api or shim the account method that's not working, ie:

account.updateRecovery = (
  userId: string,
  secret: string,
  password: string,
  passwordAgain: string,
): Promise<Models.Token> => {
  if (!userId || !secret || !password || !passwordAgain) {
    throw new Error('Missing argument');
  }
  const uri = new URL(client.config.endpoint + '/account/recovery');
  return await client.call('put', uri, {
    'content-type': 'application/json',
  }, { userId, secret, password, passwordAgain });
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants