baseline
This commit is contained in:
19
pages/auth/login().php
Normal file
19
pages/auth/login().php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use MintyPHP\Service\AuthService;
|
||||
use MintyPHP\Support\Flash;
|
||||
use MintyPHP\Router;
|
||||
|
||||
if (!empty($_SESSION['user']['id'])) {
|
||||
if (Flash::has()) {
|
||||
Flash::keep();
|
||||
}
|
||||
Router::redirect("admin");
|
||||
}
|
||||
|
||||
if (isset($_POST['email'])) {
|
||||
$email = trim((string) ($_POST['email'] ?? ''));
|
||||
$password = (string) ($_POST['password'] ?? '');
|
||||
$remember = !empty($_POST['remember']);
|
||||
AuthService::loginAndRedirect($email, $password, 'admin', 'login', $remember);
|
||||
}
|
||||
Reference in New Issue
Block a user