mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-11 18:26:28 +00:00
fix return on API call and fix id in clear for user
This commit is contained in:
parent
2a94b1d1b7
commit
d29bfaf139
2 changed files with 4 additions and 7 deletions
|
@ -43,7 +43,7 @@ class WallabagRestController extends Controller
|
||||||
$entries = $this
|
$entries = $this
|
||||||
->getDoctrine()
|
->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository('WallabagCoreBundle:Entry')
|
||||||
->findEntries(1, $isArchived, $isStarred, $isDeleted, $sort, $order);
|
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
|
||||||
|
|
||||||
if (!is_array($entries)) {
|
if (!is_array($entries)) {
|
||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
|
@ -86,7 +86,7 @@ class WallabagRestController extends Controller
|
||||||
|
|
||||||
$content = Extractor::extract($url);
|
$content = Extractor::extract($url);
|
||||||
$entry = new Entry();
|
$entry = new Entry();
|
||||||
$entry->setUserId(1);
|
$entry->setUserId($this->getUser()->getId());
|
||||||
$entry->setUrl($url);
|
$entry->setUrl($url);
|
||||||
$entry->setTitle($request->request->get('title') ?: $content->getTitle());
|
$entry->setTitle($request->request->get('title') ?: $content->getTitle());
|
||||||
$entry->setContent($content->getBody());
|
$entry->setContent($content->getBody());
|
||||||
|
|
|
@ -44,6 +44,8 @@ class WsseListener implements ListenerInterface
|
||||||
$authToken = $this->authenticationManager->authenticate($token);
|
$authToken = $this->authenticationManager->authenticate($token);
|
||||||
|
|
||||||
$this->securityContext->setToken($authToken);
|
$this->securityContext->setToken($authToken);
|
||||||
|
|
||||||
|
return;
|
||||||
} catch (AuthenticationException $failed) {
|
} catch (AuthenticationException $failed) {
|
||||||
$failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage();
|
$failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage();
|
||||||
$this->logger->err($failedMessage);
|
$this->logger->err($failedMessage);
|
||||||
|
@ -56,10 +58,5 @@ class WsseListener implements ListenerInterface
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// By default deny authorization
|
|
||||||
$response = new Response();
|
|
||||||
$response->setStatusCode(403);
|
|
||||||
$event->setResponse($response);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue