mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
fix cs + read remote calendar based on user access
This commit is contained in:
@@ -45,7 +45,7 @@ class RemoteCalendarConnectAzureController
|
||||
return $this->clientRegistry
|
||||
->getClient('azure') // key used in config/packages/knpu_oauth2_client.yaml
|
||||
->redirect([
|
||||
'https://graph.microsoft.com/.default'
|
||||
'https://graph.microsoft.com/.default', 'offline_access',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Controller;
|
||||
|
||||
use Chill\CalendarBundle\Synchro\Connector\MSGraph\RemoteEventConverter;
|
||||
use Chill\CalendarBundle\Synchro\Connector\RemoteCalendarConnectorInterface;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use DateTimeImmutable;
|
||||
@@ -31,7 +30,6 @@ class RemoteCalendarProxyController
|
||||
|
||||
private SerializerInterface $serializer;
|
||||
|
||||
|
||||
public function __construct(RemoteCalendarConnectorInterface $remoteCalendarConnector, SerializerInterface $serializer)
|
||||
{
|
||||
$this->remoteCalendarConnector = $remoteCalendarConnector;
|
||||
@@ -45,8 +43,9 @@ class RemoteCalendarProxyController
|
||||
{
|
||||
if ($request->query->has('startDate')) {
|
||||
$startDate = DateTimeImmutable::createFromFormat('Y-m-d', $request->query->get('startDate'));
|
||||
|
||||
if (false === $startDate) {
|
||||
throw new BadRequestHttpException("startDate on bad format");
|
||||
throw new BadRequestHttpException('startDate on bad format');
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestHttpException('startDate not provided');
|
||||
@@ -54,8 +53,9 @@ class RemoteCalendarProxyController
|
||||
|
||||
if ($request->query->has('endDate')) {
|
||||
$endDate = DateTimeImmutable::createFromFormat('Y-m-d', $request->query->get('endDate'));
|
||||
|
||||
if (false === $endDate) {
|
||||
throw new BadRequestHttpException("endDate on bad format");
|
||||
throw new BadRequestHttpException('endDate on bad format');
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestHttpException('endDate not provided');
|
||||
|
Reference in New Issue
Block a user