render('home/index.html.twig', [ ]); } #[Route('/osm/request', name: 'app_osm_request')] public function osmRequest(ClientRegistry $clientRegistry): Response { return $clientRegistry ->getClient('openstreetmap') ->redirect([ 'read_prefs', ]); } #[Route('/osm/callback', name: 'app_osm_callback')] public function osmCallback(Request $request, ClientRegistry $clientRegistry): Response { $client = $clientRegistry->getClient('openstreetmap'); try { $resourceOwner = $client->fetchUser(); $this->addFlash('success', 'Authentification OSM réussie !'); } catch (IdentityProviderException $exception) { $this->addFlash('danger', 'Échec de l’authentification OSM !'); } return $this->redirectToRoute('app_home'); } #[Route('/osm/logout', name: 'app_osm_logout')] public function osmLogout(Security $security): Response { return $security->logout(); } }