Created mock up login
parent
c58afe873f
commit
8fba590e9c
|
@ -6,6 +6,7 @@ use App\Entity\Image;
|
||||||
use App\Entity\OrganizationalUnit;
|
use App\Entity\OrganizationalUnit;
|
||||||
use App\Model\OrganizationalUnitTypes;
|
use App\Model\OrganizationalUnitTypes;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Random\RandomException;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@ -22,6 +23,21 @@ class OrganizationalUnitController extends AbstractController
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws RandomException
|
||||||
|
*/
|
||||||
|
#[Route('/opengnsys/rest//login', methods: ['POST'])]
|
||||||
|
public function login(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$data = [
|
||||||
|
'userid' => 1,
|
||||||
|
'apikey' => bin2hex(random_bytes(32))
|
||||||
|
];
|
||||||
|
|
||||||
|
return new JsonResponse($data, Response::HTTP_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#[Route('/opengnsys/rest//ous', methods: ['GET'])]
|
#[Route('/opengnsys/rest//ous', methods: ['GET'])]
|
||||||
public function getOUs(Request $request): JsonResponse
|
public function getOUs(Request $request): JsonResponse
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue