nginx-rtmp-auth/src/Deblan/Bundle/RtmpBundle/Controller/AuthController.php

31 lines
731 B
PHP
Raw Normal View History

2016-10-08 14:40:30 +02:00
<?php
namespace Deblan\Bundle\RtmpBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Routing\Annotation\Route;
2016-10-08 15:37:42 +02:00
use Symfony\Component\HttpFoundation\Response;
2016-10-08 14:40:30 +02:00
/**
* @author Simon Vieille <simon@deblan.fr>
*/
class AuthController extends Controller
{
/**
* @param Request $request
*
2016-10-08 15:37:42 +02:00
* @return Response
*
* @Route("/auth", name="auth")
2016-10-08 14:40:30 +02:00
*/
public function authAction(Request $request)
{
2016-10-08 15:37:42 +02:00
$authProvider = $this->container->get('rtmp.auth.propel_provider');
$authProvider->handleRequest($request);
return new Response(null, $authProvider->isValid() ? 200 : 401);
2016-10-08 14:40:30 +02:00
}
}