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:
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user