mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-03 14:26:29 +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
|
||||
->getDoctrine()
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findEntries(1, $isArchived, $isStarred, $isDeleted, $sort, $order);
|
||||
->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $isDeleted, $sort, $order);
|
||||
|
||||
if (!is_array($entries)) {
|
||||
throw $this->createNotFoundException();
|
||||
|
@ -86,7 +86,7 @@ class WallabagRestController extends Controller
|
|||
|
||||
$content = Extractor::extract($url);
|
||||
$entry = new Entry();
|
||||
$entry->setUserId(1);
|
||||
$entry->setUserId($this->getUser()->getId());
|
||||
$entry->setUrl($url);
|
||||
$entry->setTitle($request->request->get('title') ?: $content->getTitle());
|
||||
$entry->setContent($content->getBody());
|
||||
|
|
|
@ -44,6 +44,8 @@ class WsseListener implements ListenerInterface
|
|||
$authToken = $this->authenticationManager->authenticate($token);
|
||||
|
||||
$this->securityContext->setToken($authToken);
|
||||
|
||||
return;
|
||||
} catch (AuthenticationException $failed) {
|
||||
$failedMessage = 'WSSE Login failed for '.$token->getUsername().'. Why ? '.$failed->getMessage();
|
||||
$this->logger->err($failedMessage);
|
||||
|
@ -56,10 +58,5 @@ class WsseListener implements ListenerInterface
|
|||
|
||||
return;
|
||||
}
|
||||
|
||||
// By default deny authorization
|
||||
$response = new Response();
|
||||
$response->setStatusCode(403);
|
||||
$event->setResponse($response);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue