I just started with Apigility and oAuth2, and I was wondering if it is possible to get the currently authenticated user "loggedin" while retrieving information from the database.
I currently have the following code:
public function fetchAll($params = array())
{
var_dump($params);
$sql = new \Zend\Db\Sql\Sql($this->db);
$select = $sql->select('projects')->where(array('userid' => 1));;
$paged = new \Zend\Paginator\Adapter\DbSelect($select, $this->db);
return new ProjectsCollection($paged);
}
I’ve searched a lot already, but don’t know how to access user information or access token, do I need to parse the request header for this?
source
share