Hello, what is the right way to pass oldPassword parameters to change password? I referred to the documentation, but i can't get it right.
The below gave me error Invalid password: Password must be at least 8 characters. I confirm that both my old and new password is >8 chars.
return account.updatePassword(
{
password: newPassword,
oldPassword: currentPassword
});
The below gave me error oldPassword is not defined.
return account.updatePassword(newPassword, currentPassword);
both newPassword and currentPassword are variables that I passed to the function
Hi , thank you for your doubt, please allow me a moment to look into this and get back to you
Thanks a lot
Can you please once confirm which language this code belongs to?
React.
Hey, so the code snippet looks okay, can you please one share here the error msgs and network logs?
Hi, joeyouss! VoidCupboard is currently AFK for a hot minute, he gotta deal with some shit (IRL). he will reply you as sson as he gets back ^-^
This is not the human you were looking for. It's just me, a bot!
Hello @joeyouss , here you go. with the password that i keyed in. Also, i tried multiple combinations that are >8 chars.
What exactly is your code now and what shows up in the payload tab rather than headers?
I retried with another password, here's the payload and exact code
const updatePassword = (newPassword, currentPassword) => {
return account.updatePassword(
{
password: newPassword,
oldPassword: currentPassword
});
};
This syntax is incorrect. Update password takes 2 strings, not 1 object
actually i tried the below before, and it gave me error oldPassword is not defined.
return account.updatePassword(newPassword, currentPassword);
let me retry now
it works now!
Thanks a lot
Can we mark this as resolved?
Absolutely. Thanks for all the help
Always happy to be of use!
[SOLVED] Change password
Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- createEmailPasswordSession Error using S...
Did someone succeed using SSR approach for login?
- [Solved] how to get user prefs from serv...
i want to get a specific users preferences from serverside maybe i missunderstood something