fixed login

added example login
This commit is contained in:
Maurice Grönwoldt 2020-09-25 22:33:35 +02:00
commit c7984873c0
6 changed files with 48 additions and 8 deletions

View file

@ -4,12 +4,27 @@
namespace Venom\Admin\Routes;
use Venom\Core\ArgumentHandler;
use Venom\Routing\Route;
use Venom\Security\Security;
class LoginRoute implements Route
{
public function getAll(): bool {
public function login(): bool
{
Security::get()->login();
return true;
}
public function handle($fnc): bool
{
if ($fnc === 'logout') {
Security::get()->logout();
$url = ArgumentHandler::get()->getPostItem('REDIRECT_TO', '/admin/');
header('Location: ' . $url);
die();
}
return true;
}
}