Skip to content

Commit

Permalink
Version handler
Browse files Browse the repository at this point in the history
  • Loading branch information
a-menshchikov committed Jul 28, 2023
1 parent fe1dfb7 commit 39e3b8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
6 changes: 1 addition & 5 deletions shared/homeless/config/packages/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
$mainFirewall->switchUser();

$security->accessControl()
->path('^/login$')
->roles(AuthenticatedVoter::PUBLIC_ACCESS)
;
$security->accessControl()
->path('^/resetting')
->path('^/(login|resetting|app/version)$')
->roles(AuthenticatedVoter::PUBLIC_ACCESS)
;
$security->accessControl()
Expand Down
21 changes: 21 additions & 0 deletions shared/homeless/src/Controller/App/Version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
// SPDX-License-Identifier: BSD-3-Clause

declare(strict_types=1);

namespace App\Controller\App;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route('/version', name: 'version')]
class Version extends AbstractController
{
private const VERSION = '2.0';

public function __invoke(): Response
{
return new Response(self::VERSION);
}
}

0 comments on commit 39e3b8b

Please sign in to comment.