Fixed CORS
This commit is contained in:
@@ -48,13 +48,6 @@ class mfBaseApicontroller {
|
||||
$this->init();
|
||||
}
|
||||
|
||||
if($this->requireAuth) {
|
||||
$this->authenticateUser();
|
||||
if(method_exists($this,"authenticated")) {
|
||||
$this->authenticated();
|
||||
}
|
||||
}
|
||||
|
||||
// Apicontroller should add allowed hostnames with $this->addAllowedOrigin()
|
||||
$this->createCorsHeaders();
|
||||
|
||||
@@ -64,6 +57,15 @@ class mfBaseApicontroller {
|
||||
$this->return(mfResponse::Ok());
|
||||
}
|
||||
|
||||
if($this->requireAuth) {
|
||||
$this->authenticateUser();
|
||||
if(method_exists($this,"authenticated")) {
|
||||
$this->authenticated();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// route to action
|
||||
$this->route = $params['apicall'].((array_key_exists("apiparams", $params)) ? $params['apiparams'] : "");
|
||||
$responseData = $this->runRoute($this->route);
|
||||
|
||||
Reference in New Issue
Block a user