From 63e13502dc978d83a74c3300b36ad7e9c6372ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Thu, 4 May 2023 17:37:37 +0200 Subject: [PATCH] Fix #100 Fix and move the SMS log to OvhSMS library --- flexiapi/app/Http/Controllers/Api/AccountController.php | 1 - flexiapi/app/Libraries/OvhSMS.php | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/flexiapi/app/Http/Controllers/Api/AccountController.php b/flexiapi/app/Http/Controllers/Api/AccountController.php index 466711b..ce2c0a7 100644 --- a/flexiapi/app/Http/Controllers/Api/AccountController.php +++ b/flexiapi/app/Http/Controllers/Api/AccountController.php @@ -153,7 +153,6 @@ class AccountController extends Controller $account->save(); Log::channel('events')->info('API: Account created using the public endpoint by phone', ['id' => $account->identifier]); - Log::channel('events')->info('OVH SMS sending: Sending an SMS with the recovery code', ['id' => $account->identifier, 'confirmation_key', $account->conformation_key]); $ovhSMS = new OvhSMS; $ovhSMS->send($request->get('phone'), 'Your ' . config('app.name') . ' recovery code is ' . $account->confirmation_key); diff --git a/flexiapi/app/Libraries/OvhSMS.php b/flexiapi/app/Libraries/OvhSMS.php index 1dfc536..4026bcd 100644 --- a/flexiapi/app/Libraries/OvhSMS.php +++ b/flexiapi/app/Libraries/OvhSMS.php @@ -71,6 +71,8 @@ class OvhSMS 'validityPeriod' => 2880 ]; + Log::channel('events')->info('OVH SMS sending', ['to' => $to, 'message' => $message]); + try { $this->api->post('/sms/'. $this->smsService . '/jobs', $content); // One credit removed