public function getCurrentUser($token)
{
$tokens = $this->factory->create('Tokens');
$token = $tokens->getToken($token);
$uid = $token['uid'];
Verify::isTrue($token['uid'], new Forbidden('invalid uid ' . $uid));
$res = $this->getUserByIds([$uid]);
Verify::isTrue(count($res) != 0, new NotFound("user {$uid} not found"));
return $res[0];
}