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
- script "build" was terminated by signal ...
Heyo, For some reason, my Next.js 16.0.10 version does not build properly. Here is the last logs: ``` 1063 packages installed [22.54s] $ next build ⚠ No build...
- Error with realtime channels
I'm performing a subscription to realtime channels, and after a few seconds I get an exception with this error: {\"type\":\"error\",\"data\":{\"code\":1008,\"me...
- Error 400: redirect_uri_mismatch
Hi team, Google OAuth was working fine with our Appwrite Cloud setup until yesterday. We did not change any configuration in Appwrite, Google Cloud, or our cod...