Fixed tokens revokation

This commit is contained in:
Stephan D
2025-12-22 21:22:51 +01:00
parent 41b0dec460
commit 6527d183ec
22 changed files with 39 additions and 32 deletions

View File

@@ -11,7 +11,9 @@ class ChangePassword {
@JsonKey(name: 'new')
final String newPassword;
const ChangePassword({required this.oldPassword, required this.newPassword});
final String deviceId;
const ChangePassword({required this.oldPassword, required this.newPassword, required this.deviceId});
factory ChangePassword.fromJson(Map<String, dynamic> json) => _$ChangePasswordFromJson(json);
Map<String, dynamic> toJson() => _$ChangePasswordToJson(this);

View File

@@ -1,4 +1,5 @@
import 'package:logging/logging.dart';
import 'package:pshared/service/device_id.dart';
import 'package:share_plus/share_plus.dart';
@@ -66,7 +67,11 @@ class AccountService {
return _getAccount(AuthorizationService.getPATCHResponse(
_objectType,
'password',
ChangePassword(oldPassword: oldPassword, newPassword: newPassword).toJson(),
ChangePassword(
oldPassword: oldPassword,
newPassword: newPassword,
deviceId: await DeviceIdManager.getDeviceId(),
).toJson(),
));
}