mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Show security questions
This commit is contained in:
@ -130,10 +130,20 @@ class AccountHelper {
|
||||
/// Throws in case of failure
|
||||
static Future<bool> hasSecurityQuestions(String email) async =>
|
||||
(await APIRequest.withoutLogin("account/has_security_questions")
|
||||
.addString("email", email)
|
||||
.execWithThrow())
|
||||
.addString("email", email)
|
||||
.execWithThrow())
|
||||
.getObject()["defined"];
|
||||
|
||||
/// Get the security questions of the user
|
||||
///
|
||||
/// Throws in case of failure
|
||||
static Future<List<String>> getSecurityQuestions(String email) async =>
|
||||
((await APIRequest.withoutLogin("account/get_security_questions")
|
||||
.addString("email", email)
|
||||
.execWithThrow())
|
||||
.getObject()["questions"])
|
||||
.cast<String>();
|
||||
|
||||
/// Get current user ID from the server
|
||||
Future<int> _downloadCurrentUserID() async {
|
||||
final response = await APIRequest(
|
||||
|
Reference in New Issue
Block a user