mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Send answers back to the server
This commit is contained in:
@ -144,6 +144,20 @@ class AccountHelper {
|
||||
.getObject()["questions"])
|
||||
.cast<String>();
|
||||
|
||||
/// Validate given security answers
|
||||
///
|
||||
/// Throws an [Exception] in case of failure
|
||||
///
|
||||
/// Returns a password reset token in case of success
|
||||
static Future<String> checkAnswers(
|
||||
String email, List<String> answers) async =>
|
||||
(await APIRequest.withoutLogin("account/check_security_answers")
|
||||
.addString("email", email)
|
||||
.addString("answers",
|
||||
answers.map((f) => Uri.encodeComponent(f)).join("&"))
|
||||
.execWithThrow())
|
||||
.getObject()["reset_token"];
|
||||
|
||||
/// Get current user ID from the server
|
||||
Future<int> _downloadCurrentUserID() async {
|
||||
final response = await APIRequest(
|
||||
|
Reference in New Issue
Block a user