mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 01:58:07 +00:00
Fix FLEXIAPI-174 Check if the phone is valid before trying to recover it (deprecated endpoint)
This commit is contained in:
parent
b9292fde97
commit
a9a7fffd9b
3 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue