
This is my code:
const result = await account.updatePassword(
newPassword
);
This is my error:
[AppwriteException: Invalid credentials. Please check the email and password.]

you need to pass the old password

I was about to say same thing But in the docs it says old password is optional?
const result = await account.updatePassword(
'', // password
'password' // oldPassword (optional)
);
From the docs

docs:

Ahh, my bad. Did not read that 😐

I used OTP for forgotten password and wanted an option to update their password. I can't use oldPassword because the point is the user had forgot it:/

I'd rather not use magicUrl as I'm developing a mobile app. With magicUrl I would either need to set up a website or host a page of my react native app. Or any other ideas?

Oh I see I could open my app from magicURL if I set the url param to one that opens my app. But it only accepts URLs I set for Platform in my Appwrite Console. Not sure if that url could open my app? Even if it could, I'd rather not depend on this url as it may not work depending on the user's device

An url can open your app if you have setup universal linking. I dont know if it will accept deeplink scheme....

yes, a URL can, BUT I can only set the Platforms as URL from my Appwrite console. Not sure if those can work as one that opens my app

what do you mean? Can you explain a bit?


And were you trying this method? User forgot password-> send otp->check otp-> update new password?

yes, exactly

I am not fully understanding it.
Let me clear the universal linking from my part,
In your hosted site you can put a json file with your app sha256 key and package id. When you install that app android sends a ping to that domain and checks validity. Now your app will always open the links related to the domain you shared. Like opening fb app with facebook.com. i am sorry if I did not get your requirements right

That is not possible afaik. For updating user password you will call passwordrecovery method with email of the user and your redirection url. Now appwrite sends a fully modified link with secret code and user id. User clicks this and it opens your app where you can catch the params and use then to update the recovery. You can still use your own method but you have to make it yourself with your workflow and verification with cloud functions

I don't host a site, and that's what I'm trying to avoid

Ok You can still use cloud functions


Check this out

This is true, but I don't find opening my app from a url reliable. Often times when I use a url like so, it would open in browser instead of the app
Recommended threads
- [Error: AppwriteException: User (role: g...
After logging in successfully I am getting this Error. Before I impleamented this helper function: export async function updateUserPassword(oldPassword, newP...
- .setDevKey is not a function
React Native Appwrite doesn't recognize Client.setDevKey
- How to run the "starter-for-react-native...
Normally i use expo, but the folder starter-for-react-native app. doesnt have the files made for it. I'm lost, what do i do?
