mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +00:00
commit
f4cb0ca048
3 changed files with 18 additions and 0 deletions
|
@ -99,6 +99,7 @@
|
|||
- Updated ApiV1Controller, fix timeline default limit. ([a87f8301](https://github.com/pixelfed/pixelfed/commit/a87f8301))
|
||||
- Updated ApiV1Controller, fix search v2 entities. ([9dac861e](https://github.com/pixelfed/pixelfed/commit/9dac861e))
|
||||
- Updated ApiV1Controller, fix apps endpoint. ([50baae52](https://github.com/pixelfed/pixelfed/commit/50baae52))
|
||||
- Updated ApiV1Controller, add apps/verify_credentials endpoint. ([c4d38c20](https://github.com/pixelfed/pixelfed/commit/c4d38c20))
|
||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||
|
||||
## [v0.11.2 (2022-01-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.1...v0.11.2)
|
||||
|
|
|
@ -96,6 +96,21 @@ class ApiV1Controller extends Controller
|
|||
return response()->json($res, $code, $headers, JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
|
||||
public function getApp(Request $request)
|
||||
{
|
||||
if(!$request->user()) {
|
||||
return response('', 403);
|
||||
}
|
||||
$client = $request->user()->token()->client;
|
||||
$res = [
|
||||
'name' => $client->name,
|
||||
'website' => null,
|
||||
'vapid_key' => null
|
||||
];
|
||||
|
||||
return $this->json($res);
|
||||
}
|
||||
|
||||
public function apps(Request $request)
|
||||
{
|
||||
abort_if(!config_cache('pixelfed.oauth_enabled'), 404);
|
||||
|
|
|
@ -21,6 +21,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
|
||||
Route::group(['prefix' => 'v1'], function() use($middleware) {
|
||||
Route::post('apps', 'Api\ApiV1Controller@apps');
|
||||
Route::get('apps/verify_credentials', 'Api\ApiV1Controller@getApp')->middleware($middleware);
|
||||
Route::get('instance', 'Api\ApiV1Controller@instance');
|
||||
Route::get('bookmarks', 'Api\ApiV1Controller@bookmarks')->middleware($middleware);
|
||||
|
||||
|
@ -58,6 +59,7 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
|
|||
Route::post('follow_requests/{id}/reject', 'Api\ApiV1Controller@accountFollowRequestReject')->middleware($middleware);
|
||||
Route::get('lists', 'Api\ApiV1Controller@accountLists')->middleware($middleware);
|
||||
Route::post('media', 'Api\ApiV1Controller@mediaUpload')->middleware($middleware);
|
||||
Route::get('media/{id}', 'Api\ApiV1Controller@mediaGet')->middleware($middleware);
|
||||
Route::put('media/{id}', 'Api\ApiV1Controller@mediaUpdate')->middleware($middleware);
|
||||
Route::get('mutes', 'Api\ApiV1Controller@accountMutes')->middleware($middleware);
|
||||
Route::get('notifications', 'Api\ApiV1Controller@accountNotifications')->middleware($middleware);
|
||||
|
|
Loading…
Reference in a new issue