resetPassword static method
Returns a map with the following keys: if there was no error:
token
:Token
from Appwrite if there was an error:error
:true
if there was an errortype
:error
if there was an errormessage
:String
containing the error messagecode
:int
containing the error code
Implementation
static Future<Map<String, dynamic>> resetPassword({
/// User ID
required String userId,
/// Secret token
required String secret,
/// Password for the email
required String password,
/// Password confirmation for the email
required String passwordAgain,
}) async {
try {
final models.Token token = await _account.updateRecovery(
userId: _token!.userId,
secret: _token!.secret,
password: password,
passwordAgain: passwordAgain,
);
return token.toMap();
} on AppwriteException catch (e) {
return {
'error': true,
'type': e.type,
'message': e.message,
'code': e.code,
};
}
}