fixed login
added example login
This commit is contained in:
parent
f00bdc99ec
commit
c7984873c0
6 changed files with 48 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue