diff --git a/app/Http/Controllers/Api/Mini/AccountController.php b/app/Http/Controllers/Api/Mini/AccountController.php index f2a45cc..f690f7e 100644 --- a/app/Http/Controllers/Api/Mini/AccountController.php +++ b/app/Http/Controllers/Api/Mini/AccountController.php @@ -18,11 +18,27 @@ class AccountController extends Controller $account = ladill_account(); $settings = $account->getOrCreateQrSetting(); + // Phone lives on the central account, not the local mirror — fetch it, + // but never let a transient identity-API hiccup break settings loading. + $phone = ''; + $phoneCc = ''; + try { + $profile = $this->identitySend('GET', '/api/identity/profile?user='.urlencode((string) $account->public_id), []); + if ($profile->successful()) { + $phone = (string) $profile->json('data.phone', ''); + $phoneCc = (string) $profile->json('data.phone_cc', ''); + } + } catch (\Throwable) { + // leave phone blank + } + return response()->json([ 'data' => [ 'profile' => [ 'name' => $account->name, 'email' => $account->email, + 'phone' => $phone, + 'phone_cc' => $phoneCc, ], 'notifications' => [ 'notify_email' => $settings->notify_email ?: $account->email,