+signup +login
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
Some checks failed
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/db Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/chain_gateway Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/nats Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/bump_version Pipeline failed
This commit is contained in:
@@ -4,7 +4,10 @@ import 'package:share_plus/share_plus.dart';
|
||||
|
||||
import 'package:pshared/api/requests/signup.dart';
|
||||
import 'package:pshared/api/responses/account.dart';
|
||||
import 'package:pshared/api/requests/change_password.dart';
|
||||
import 'package:pshared/api/requests/login_data.dart';
|
||||
import 'package:pshared/api/requests/password/change.dart';
|
||||
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/service/authorization/service.dart';
|
||||
@@ -17,9 +20,9 @@ class AccountService {
|
||||
static final _logger = Logger('service.account');
|
||||
static const String _objectType = Services.account;
|
||||
|
||||
static Future<Account> login(String email, String password, String locale) async {
|
||||
static Future<Account> login(LoginData login) async {
|
||||
_logger.fine('Logging in');
|
||||
return AuthorizationService.login(_objectType, email, password, locale);
|
||||
return AuthorizationService.login(_objectType, login);
|
||||
}
|
||||
|
||||
static Future<Account> restore() async {
|
||||
@@ -27,6 +30,7 @@ class AccountService {
|
||||
}
|
||||
|
||||
static Future<void> signup(SignupRequest request) async {
|
||||
// Use regular HTTP for public signup endpoint (no auth needed)
|
||||
await getPOSTResponse(_objectType, 'signup', request.toJson());
|
||||
}
|
||||
|
||||
@@ -42,9 +46,20 @@ class AccountService {
|
||||
|
||||
static Future<Account> update(Account account) async {
|
||||
_logger.fine('Patching account ${account.id}');
|
||||
// Use AuthorizationService for authenticated operations
|
||||
return _getAccount(AuthorizationService.getPUTResponse(_objectType, '', account.toDTO().toJson()));
|
||||
}
|
||||
|
||||
static Future<void> forgotPassword(String email) async {
|
||||
_logger.fine('Requesting password reset for email: $email');
|
||||
await getPUTResponse(_objectType, 'password', ForgotPasswordRequest.build(login: email).toJson());
|
||||
}
|
||||
|
||||
static Future<void> resetPassword(String accountRef, String token, String newPassword) async {
|
||||
_logger.fine('Resetting password for account: $accountRef');
|
||||
await getPOSTResponse(_objectType, 'password/reset/$accountRef/$token', ResetPasswordRequest.build(password: newPassword).toJson());
|
||||
}
|
||||
|
||||
static Future<Account> changePassword(String oldPassword, String newPassword) async {
|
||||
_logger.fine('Changing password');
|
||||
return _getAccount(AuthorizationService.getPATCHResponse(
|
||||
|
||||
Reference in New Issue
Block a user