ShibaOriginal post
Rank 3: Container
Dart
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; } }Dart
account.createSession(userId: userId, secret: secret)Dart
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 !!
Summary
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.