Allow bookmarks to be sent to 3rd party services with Fever API

This commit is contained in:
Frederic Guillot 2017-01-03 20:57:33 -05:00
parent 2a87847289
commit f64e74952b

View File

@ -4,6 +4,7 @@ require __DIR__.'/../app/common.php';
use Miniflux\Handler; use Miniflux\Handler;
use Miniflux\Model; use Miniflux\Model;
use Miniflux\Session\SessionStorage;
register_shutdown_function(function () { register_shutdown_function(function () {
Miniflux\Helper\write_debug_file(); Miniflux\Helper\write_debug_file();
@ -36,6 +37,10 @@ function auth()
$user = Model\User\get_user_by_token('fever_api_key', $api_key); $user = Model\User\get_user_by_token('fever_api_key', $api_key);
$authenticated = $user !== null; $authenticated = $user !== null;
if ($authenticated) {
SessionStorage::getInstance()->setUser($user);
}
$response = array( $response = array(
'api_version' => 3, 'api_version' => 3,
'auth' => (int) $authenticated, 'auth' => (int) $authenticated,