
TypeScript
Future<bool> resetPassword(
ParamsForPassword resetPassword,
String newPassword,
) async {
try {
await account.updateRecovery(
userId: resetPassword.userId,
secret: resetPassword.secret,
password: newPassword,
);
return true;
} on AppwriteException catch (e) {
Utils.toast(e.message ?? "");
Utils.debLog(e);
return false;
}
}
TypeScript
account.createSession(userId: userId, secret: secret)
TypeScript
final user = await account.get();
updateRecovery()
gives me Token in return ;- took the Token.secret
account.createSession(userId: resetPassword.userId, secret: Token.secret)
giving error as Token invalid !!
TL;DR
When resetting a password, developers can create a new session for the user using the token from `updateRecovery()`. To fix the "Token invalid" error, make sure to correctly pass the user ID and corresponding token when creating the session.Recommended threads
- SSO google apple not working anymore
We use Apple and Google sso in our react native app. Everything worked fine until we noticed today that we see general argument error. We did not change anythi...
- Origin error after changing default port...
Hi! I need some help regarding an issue I’m facing with Appwrite after changing the default ports. I have a self-hosted Appwrite instance running on my VPS. I ...
- Opened my website after long time and Ba...
I built a website around a year back and and used appwrite for making the backend. At that time the website was working fine but now when i open it the images a...
