Updated Settings Page
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'package:pshared/api/requests/signup.dart';
|
||||
@@ -10,6 +9,7 @@ import 'package:pshared/api/requests/password/forgot.dart';
|
||||
import 'package:pshared/api/requests/password/reset.dart';
|
||||
import 'package:pshared/data/mapper/account/account.dart';
|
||||
import 'package:pshared/models/account/account.dart';
|
||||
import 'package:pshared/models/describable.dart';
|
||||
import 'package:pshared/models/auth/login_outcome.dart';
|
||||
import 'package:pshared/service/authorization/service.dart';
|
||||
import 'package:pshared/service/files.dart';
|
||||
@@ -61,6 +61,14 @@ class AccountService {
|
||||
await getPOSTResponse(_objectType, 'password/reset/$accountRef/$token', ResetPasswordRequest.build(password: newPassword).toJson());
|
||||
}
|
||||
|
||||
static Future<Account> resetUsername(Account account, String userName) async {
|
||||
_logger.fine('Updating username for account: ${account.id}');
|
||||
final updatedAccount = account.copyWith(
|
||||
describable: account.describable.copyWith(name: userName),
|
||||
);
|
||||
return update(updatedAccount);
|
||||
}
|
||||
|
||||
static Future<Account> changePassword(String oldPassword, String newPassword) async {
|
||||
_logger.fine('Changing password');
|
||||
return _getAccount(AuthorizationService.getPATCHResponse(
|
||||
|
||||
Reference in New Issue
Block a user