Refactor auth method: http basic > user login

This commit is contained in:
billz
2025-01-21 05:14:18 -08:00
parent bc7d4ef1c1
commit 21b9feb0ef
2 changed files with 6 additions and 22 deletions

View File

@@ -1,16 +1,10 @@
<?php
if (RASPI_AUTH_ENABLED) {
$user = $_SERVER['PHP_AUTH_USER'] ?? '';
$pass = $_SERVER['PHP_AUTH_PW'] ?? '';
$auth = new \RaspAP\Auth\HTTPAuth;
if (!$auth->isLogged()) {
if ($auth->login($user, $pass)) {
$config = $auth->getAuthConfig();
} else {
$auth->authenticate();
}
$auth->authenticate();
}
}