public function before() { parent::before(); $key = Core::request('user_token'); //try authenticate the user if ($key == NULL or ($this->user = Auth::instance()->api_login($key)) == FALSE) { $this->_error(__('Wrong Api User Token'), 401); } }
public function before() { parent::before(); $key = Core::request('apikey'); //try normal api key not user if ($key != Core::config('general.api_key')) { $this->_error(__('Wrong Api Key'), 401); } }
public function before() { parent::before(); if (Theme::get('premium') != 1) { $this->_error('You need a premium theme to use the API', 401); } $key = Core::request('user_token'); //try authenticate the user if ($key == NULL or ($this->user = Auth::instance()->api_login($key)) == FALSE) { $this->_error(__('Wrong Api User Token'), 401); } }
public function before() { parent::before(); if (Theme::get('premium') != 1) { $this->_error('You need a premium theme to use the API', 401); } $key = Core::request('apikey'); //try normal api key not user if ($key != Core::config('general.api_key')) { $this->_error(__('Wrong Api Key'), 401); } }