resetEmailPassword 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>> resetEmailPassword({
/// Email of the user to reset password
required String email,
}) async {
Account account = Account(_client);
try {
final models.Token token = await account.createRecovery(
email: email,
url: _recovery ?? _client.endPoint,
);
_token = token;
return token.toMap();
} on AppwriteException catch (e) {
return {
'error': true,
'type': e.type,
'message': e.message,
'code': e.code,
};
}
}