bug fixing

This commit is contained in:
Roland Schneider 2021-09-28 19:56:55 +02:00
parent f9c845f722
commit 300defb905
2 changed files with 13 additions and 12 deletions

View File

@ -28,7 +28,7 @@ use yii\web\Response;
/** @noinspection PhpUnused */ /** @noinspection PhpUnused */
class EventController extends CustomerApiController class EventController extends RestController
{ {
/** @noinspection PhpUnused */ /** @noinspection PhpUnused */
/** /**

View File

@ -20,18 +20,18 @@ class RestController extends Controller
{ {
$behaviors = parent::behaviors(); $behaviors = parent::behaviors();
// $auth = $behaviors['authenticator']; $auth = $behaviors['authenticator'];
// unset($behaviors['authenticator']); unset($behaviors['authenticator']);
// $behaviors['corsFilter'] = [ $behaviors['corsFilter'] = [
// 'class' => CorsCustom::class, 'class' => Cors::class,
// 'cors' => [ 'cors' => [
// // restrict access to 'Origin' => ['https://botondfitness.hu'],
// 'Origin' => ['https://botondfitness.hu'], 'Access-Control-Request-Method' => ['POST', 'GET', 'OPTIONS'],
// // Allow credentials (cookies, authorization headers, etc.) to be exposed to the browser 'Access-Control-Allow-Headers' => ['*'],
// 'Access-Control-Allow-Credentials' => true, 'Access-Control-Expose-Headers' => ['*']
// ] ],
// ]; ];
// $behaviors['authenticator'] = $auth; // $behaviors['authenticator'] = $auth;
$behaviors['authenticator'] = [ $behaviors['authenticator'] = [
@ -39,6 +39,7 @@ class RestController extends Controller
'auth' => [$this, 'auth'], 'auth' => [$this, 'auth'],
'optional' => $this->getOptionalActions(), 'optional' => $this->getOptionalActions(),
]; ];
$behaviors['authenticator']['except'] = ['options'];
return $behaviors; return $behaviors;
} }