This commit is contained in:
afornerot 2020-07-06 11:19:44 +02:00
parent c856315a8d
commit e59b85701c
2 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,19 @@ use Cadoles\CoreBundle\Form\UserType;
class RestController extends Controller
{
public function loginAction($key,Request $request)
{
$output=[];
// Vérification de la clé
$realkey = $this->getParameter("apikeyninegate");
if($key!=$realkey) {
$output["error"]="error key";
return new Response(json_encode($output), 400);
}
return new Response(json_encode($output), 200);
}
public function userAction($key, $login, Request $request)
{

View File

@ -492,6 +492,10 @@ cadoles_core_config_statistic:
defaults: { _controller: CadolesCoreBundle:Statistic:list }
#== REST ==================================================================================================================
cadoles_core_rest_login:
path: /rest/login/{key}
defaults: { _controller: CadolesCoreBundle:Rest:login }
cadoles_core_rest_user:
path: /rest/user/{key}/{login}
defaults: { _controller: CadolesCoreBundle:Rest:user }