Fix FLEXIAPI-174 Check if the phone is valid before trying to recover it (deprecated endpoint)

This commit is contained in:
Timothée Jaussoin 2024-05-16 10:19:05 +00:00
parent b9292fde97
commit a9a7fffd9b
3 changed files with 8 additions and 1 deletions

View file

@ -2,6 +2,7 @@
v1.5
----
- Fix FLEXIAPI-174 Check if the phone is valid before trying to recover it (deprecated endpoint)
- Fix FLEXIAPI-173 Wrong route in validateEmail (deprecated)
- Fix FLEXIAPI-171 Fix README documentation for CreateAdminAccount
- Fix FLEXIAPI-170 Fix undefined variable apiKey in CreateAdminAccount

View file

@ -187,7 +187,7 @@ class AccountController extends Controller
$request->validate([
'phone' => [
'required', new WithoutSpaces, 'starts_with:+'
'required', new WithoutSpaces, 'starts_with:+', 'exists:accounts,phone'
],
'account_creation_token' => [
'required',

View file

@ -746,6 +746,12 @@ class ApiAccountTest extends TestCase
$token = AccountCreationToken::factory()->create();
// Wrong phone
$this->json($this->method, $this->route . '/recover-by-phone', [
'phone' => '+331234', // wrong phone number
'account_creation_token' => $token->token
])->assertJsonValidationErrors(['phone']);
$this->json($this->method, $this->route . '/recover-by-phone', [
'phone' => $phone,
'account_creation_token' => $token->token