From 12f49e23624965288b16dcd3d5bda667d1ffbe80 Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Tue, 28 Sep 2021 19:28:17 +0200 Subject: [PATCH] bug fixing --- customerapi/controllers/RestController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/customerapi/controllers/RestController.php b/customerapi/controllers/RestController.php index 296e8f6..461e697 100644 --- a/customerapi/controllers/RestController.php +++ b/customerapi/controllers/RestController.php @@ -18,11 +18,7 @@ class RestController extends Controller public function behaviors() { $behaviors = parent::behaviors(); - $behaviors['authenticator'] = [ - 'class' => JwtHttpBearerAuth::class, - 'auth' => [$this, 'auth'], - 'optional' => $this->getOptionalActions(), - ]; + $behaviors['corsFilter'] = [ 'class' => Cors::class, 'cors' => [ @@ -32,6 +28,13 @@ class RestController extends Controller 'Access-Control-Allow-Credentials' => true, ] ]; + + $behaviors['authenticator'] = [ + 'class' => JwtHttpBearerAuth::class, + 'auth' => [$this, 'auth'], + 'optional' => $this->getOptionalActions(), + ]; + return $behaviors; }