mirror of
https://github.com/grocy/grocy.git
synced 2025-08-15 10:14:39 +00:00
Added an API endpoint to get the authenticated user (closes #1165)
This commit is contained in:
@@ -126,6 +126,18 @@ class UsersApiController extends BaseApiController
|
||||
}
|
||||
}
|
||||
|
||||
public function CurrentUser(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return $this->ApiResponse($response, $this->getUsersService()->GetUsersAsDto()->where('id', GROCY_USER_ID));
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
return $this->GenericErrorResponse($response, $ex->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public function ListPermissions(\Psr\Http\Message\ServerRequestInterface $request, \Psr\Http\Message\ResponseInterface $response, array $args)
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user