bug fixing
This commit is contained in:
@@ -9,6 +9,7 @@ use Lcobucci\JWT\Token;
|
||||
use sizeg\jwt\JwtHttpBearerAuth;
|
||||
use Yii;
|
||||
use yii\filters\auth\AuthMethod;
|
||||
use yii\filters\Cors;
|
||||
use yii\rest\Controller;
|
||||
|
||||
class RestController extends Controller
|
||||
@@ -22,6 +23,15 @@ class RestController extends Controller
|
||||
'auth' => [$this, 'auth'],
|
||||
'optional' => $this->getOptionalActions(),
|
||||
];
|
||||
$behaviors['corsFilter'] = [
|
||||
'class' => Cors::class,
|
||||
'cors' => [
|
||||
// restrict access to
|
||||
'Origin' => ['https://botondfitness.hu'],
|
||||
// Allow credentials (cookies, authorization headers, etc.) to be exposed to the browser
|
||||
'Access-Control-Allow-Credentials' => true,
|
||||
]
|
||||
];
|
||||
return $behaviors;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user