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

Can change password

This commit is contained in:
2020-04-30 18:19:01 +02:00
parent 29cc8558c3
commit 289bf30a40
4 changed files with 165 additions and 1 deletions

View File

@ -151,4 +151,14 @@ class SettingsHelper {
await APIRequest(uri: "settings/check_password", needLogin: true)
.addString("password", password)
.execWithThrow();
/// Change user password
///
/// Throws in case of failure
static Future<void> changePassword(
String oldPassword, String newPassword) async =>
await APIRequest(uri: "settings/update_password", needLogin: true)
.addString("oldPassword", oldPassword)
.addString("newPassword", newPassword)
.execWithThrow();
}