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

Can ask user his password

This commit is contained in:
2020-04-30 13:32:22 +02:00
parent d64d2ece05
commit 29cc8558c3
7 changed files with 136 additions and 2 deletions

View File

@ -80,7 +80,7 @@ class APIHelper {
EventsHelper.emit(InvalidLoginTokensEvent());
if (response.statusCode != HttpStatus.ok)
return APIResponse(response.statusCode, null);
return APIResponse(response.statusCode, response.data);
return APIResponse(response.statusCode, response.data);
} catch (e, stack) {

View File

@ -143,4 +143,12 @@ class SettingsHelper {
.addInt("emojiID", emojiID)
.exec())
.assertOk();
/// Check current user password
///
/// Throws in case of failure
static Future<void> checkUserPassword(String password) async =>
await APIRequest(uri: "settings/check_password", needLogin: true)
.addString("password", password)
.execWithThrow();
}