mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can change password
This commit is contained in:
@ -158,6 +158,24 @@ class AccountHelper {
|
||||
.execWithThrow())
|
||||
.getObject()["reset_token"];
|
||||
|
||||
/// Check a password reset token
|
||||
///
|
||||
/// Throws in case failure
|
||||
static Future<void> validatePasswordResetToken(String token) async =>
|
||||
await APIRequest.withoutLogin("account/check_password_reset_token")
|
||||
.addString("token", token)
|
||||
.execWithThrow();
|
||||
|
||||
/// Change account password using password reset token
|
||||
///
|
||||
/// Throws an exception in case of failure
|
||||
static Future<void> changeAccountPassword(
|
||||
String token, String password) async =>
|
||||
await APIRequest.withoutLogin("account/reset_user_passwd")
|
||||
.addString("token", token)
|
||||
.addString("password", password)
|
||||
.execWithThrow();
|
||||
|
||||
/// Get current user ID from the server
|
||||
Future<int> _downloadCurrentUserID() async {
|
||||
final response = await APIRequest(
|
||||
|
Reference in New Issue
Block a user