Fix setup endpoint -Setup conditions where invalid.
CI / Docker Lint (push) Successful in 30s

This commit is contained in:
2024-05-13 23:18:35 +02:00
parent 2fae2fb37f
commit ca160d1543
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ volumes:
``` ```
Config details Config details
- SERVER_NAME -> if set to https a SSL cert will be obtained. If you set http, SSL will be disabled. - SERVER_NAME -> if set to https a SSL cert will be obtained. If you set http, SSL will be disabled. (Read more about this [here](https://caddyserver.com/docs/automatic-https))
Front-end: Front-end:
+3 -2
View File
@@ -37,9 +37,10 @@ class SecurityController extends AbstractController
#[Route(path: '/setup', name: 'app_security_addAdmin')] #[Route(path: '/setup', name: 'app_security_addAdmin')]
public function addAdmin(UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $entityManager): Response public function addAdmin(UserPasswordHasherInterface $passwordHasher, EntityManagerInterface $entityManager): Response
{ {
$setupStatus = $entityManager->find(ConfigVariable::class, "SETUP_STATUS"); $configRepo = $entityManager->getRepository(ConfigVariable::class);
$setupStatus = $configRepo->findBy(["key" => "SETUP_STATUS"]);
if($setupStatus == null || $setupStatus == 1) { if($setupStatus != null && $setupStatus[0] != null && $setupStatus[0]->getValue() != 1) {
return new Response("Setup was already done"); return new Response("Setup was already done");
} }