1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Check email address

This commit is contained in:
2020-05-03 14:22:06 +02:00
parent e1795bac03
commit 6e274cae11
4 changed files with 151 additions and 0 deletions

View File

@ -116,6 +116,24 @@ class AccountHelper {
}
}
/// Check out whether a given email address exists or not
///
/// Throws in case of failure
static Future<bool> existsMailAccount(String email) async =>
(await APIRequest.withoutLogin("account/exists_email")
.addString("email", email)
.execWithThrow())
.getObject()["exists"];
/// Check out whether security questions have been set for an account or not
///
/// Throws in case of failure
static Future<bool> hasSecurityQuestions(String email) async =>
(await APIRequest.withoutLogin("account/has_security_questions")
.addString("email", email)
.execWithThrow())
.getObject()["defined"];
/// Get current user ID from the server
Future<int> _downloadCurrentUserID() async {
final response = await APIRequest(