20 lines
444 B
PHP
20 lines
444 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
require __DIR__ . '/_bootstrap.php';
|
|
|
|
$username = $_POST['username'] ?? '';
|
|
$password = $_POST['password'] ?? '';
|
|
|
|
$expectedUser = $config['USERNAME'];
|
|
$expectedHash = $config['PASSWORD_HASH'];
|
|
|
|
if ($username === $expectedUser && password_verify($password, $expectedHash)) {
|
|
session_regenerate_id(true);
|
|
$_SESSION['tt_logged_in'] = true;
|
|
header('Location: /');
|
|
exit;
|
|
}
|
|
|
|
header('Location: /?err=1');
|
|
exit; |