2020-09-25 21:33:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
namespace Venom\Admin\Routes;
|
|
|
|
|
|
|
|
|
2020-09-25 22:33:35 +02:00
|
|
|
use Venom\Security\Security;
|
2020-09-25 21:33:54 +02:00
|
|
|
|
2021-01-03 16:59:11 +01:00
|
|
|
class LoginRoute
|
2020-09-25 21:33:54 +02:00
|
|
|
{
|
|
|
|
|
2020-09-25 22:33:35 +02:00
|
|
|
public function login(): bool
|
|
|
|
{
|
|
|
|
Security::get()->login();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handle($fnc): bool
|
|
|
|
{
|
|
|
|
if ($fnc === 'logout') {
|
|
|
|
Security::get()->logout();
|
2020-11-18 17:50:01 +01:00
|
|
|
echo '{"reload": true}';
|
2020-09-25 22:33:35 +02:00
|
|
|
die();
|
|
|
|
}
|
2020-09-25 21:33:54 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|