mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 10:08:05 +00:00
Fix FLEXIAPI-408 Adjustments to allow custom JWT tests and hooks
This commit is contained in:
parent
e0f33da4ac
commit
25ddd330c1
5 changed files with 21 additions and 20 deletions
|
|
@ -5,7 +5,6 @@ namespace App\Http\Controllers\Account;
|
|||
use App\ResetPasswordEmailToken;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class ResetPasswordEmailController extends Controller
|
||||
{
|
||||
|
|
|
|||
5
flexiapi/resources/views/errors/400.blade.php
Normal file
5
flexiapi/resources/views/errors/400.blade.php
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
@extends('errors::minimal')
|
||||
|
||||
@section('title', __('Bad Request'))
|
||||
@section('code', '404')
|
||||
@section('message', __($exception->getMessage() ?: 'Bad Request'))
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Account;
|
||||
use App\Password;
|
||||
use DateTimeImmutable;
|
||||
use Lcobucci\Clock\FrozenClock;
|
||||
|
|
@ -198,7 +197,7 @@ class AccountJWTAuthenticationTest extends TestCase
|
|||
$value = 'authz_server="https://auth_bearer.com/" realm="realm"';
|
||||
config()->set('app.account_authentication_bearer', $value);
|
||||
|
||||
$password = Password::factory()->create();
|
||||
Password::factory()->create();
|
||||
|
||||
$response = $this->json($this->method, $this->routeAccountMe)
|
||||
->assertStatus(401);
|
||||
|
|
@ -209,8 +208,7 @@ class AccountJWTAuthenticationTest extends TestCase
|
|||
);
|
||||
|
||||
// Wrong From
|
||||
$reponse = $this
|
||||
->withHeaders(['From' => 'sip:missing@username'])
|
||||
$this->withHeaders(['From' => 'sip:missing@username'])
|
||||
->json($this->method, $this->routeAccountMe)
|
||||
->assertStatus(401);
|
||||
|
||||
|
|
@ -220,8 +218,7 @@ class AccountJWTAuthenticationTest extends TestCase
|
|||
);
|
||||
|
||||
// Wrong bearer message
|
||||
$reponse = $this
|
||||
->withHeaders([
|
||||
$this->withHeaders([
|
||||
'Authorization' => 'Bearer 1234'
|
||||
])
|
||||
->json($this->method, $this->routeAccountMe)
|
||||
|
|
@ -233,7 +230,7 @@ class AccountJWTAuthenticationTest extends TestCase
|
|||
);
|
||||
}
|
||||
|
||||
private function checkToken(UnencryptedToken $token): void
|
||||
protected function checkToken(UnencryptedToken $token): void
|
||||
{
|
||||
$this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $token->toString(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue