mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Ensure that the confirmation code is also generated when activated is set to false during the account creation process
Bump the package number
This commit is contained in:
parent
a82d66bc48
commit
cda7864c52
3 changed files with 31 additions and 2 deletions
|
|
@ -90,7 +90,7 @@ class AccountController extends Controller
|
|||
$account->creation_time = Carbon::now();
|
||||
$account->user_agent = config('app.name');
|
||||
|
||||
if (!$request->has('activated') || !(bool)$request->has('activated')) {
|
||||
if (!$request->has('activated') || !(bool)$request->get('activated')) {
|
||||
$account->confirmation_key = Str::random(WebAuthenticateController::$emailCodeSize);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,6 +183,35 @@ class AccountApiTest extends TestCase
|
|||
$this->assertTrue(empty($response1['confirmation_key']));
|
||||
}
|
||||
|
||||
public function testNotActivated()
|
||||
{
|
||||
$admin = Admin::factory()->create();
|
||||
$admin->account->generateApiKey();
|
||||
$password = $admin->account->passwords()->first();
|
||||
|
||||
$username = 'username';
|
||||
|
||||
$response0 = $this->generateFirstResponse($password);
|
||||
$response1 = $this->generateSecondResponse($password, $response0)
|
||||
->json($this->method, $this->route, [
|
||||
'username' => $username,
|
||||
'algorithm' => 'SHA-256',
|
||||
'password' => '2',
|
||||
'activated' => false,
|
||||
]);
|
||||
|
||||
$response1
|
||||
->assertStatus(200)
|
||||
->assertJson([
|
||||
'id' => 2,
|
||||
'username' => $username,
|
||||
'domain' => config('app.sip_domain'),
|
||||
'activated' => false,
|
||||
]);
|
||||
|
||||
$this->assertFalse(empty($response1['confirmation_key']));
|
||||
}
|
||||
|
||||
public function testSimpleAccount()
|
||||
{
|
||||
$password = Password::factory()->create();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#%define _datadir %{_datarootdir}
|
||||
#%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number 43
|
||||
%define build_number 44
|
||||
%define var_dir /var/opt/belledonne-communications
|
||||
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
|
||||
%define env_file "$RPM_BUILD_ROOT/etc/flexisip-account-manager/flexiapi.env"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue