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

Send answers back to the server

This commit is contained in:
2020-05-03 16:21:36 +02:00
parent 3ffb24f7c5
commit 44ea647624
2 changed files with 28 additions and 2 deletions

View File

@ -213,14 +213,26 @@ class _ResetPasswordBodyState extends SafeState<_ResetPasswordBody> {
_canSubmitAnswers ? (s) => _submitSecurityAnswers() : null,
decoration: InputDecoration(
alignLabelWithHint: false,
labelText: tr("Answer %num%", args: {"num": id.toString()})),
labelText:
tr("Answer %num%", args: {"num": (id + 1).toString()})),
),
_Spacer()
],
);
/// Submit security answers
Future<void> _submitSecurityAnswers() async {}
Future<void> _submitSecurityAnswers() async {
_setLoading(true);
try {
final token = await AccountHelper.checkAnswers(_emailAddress, _answers);
print(token);
} catch (e, s) {
print("Could not submit security answers! $e\n$s");
showSimpleSnack(
context, tr("Could not validate these security answers!"));
}
_setLoading(false);
}
}
class _Spacer extends StatelessWidget {