Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/NGINXController.php
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | public function httpauth(Request $request) | ||||
X-Forwarded-Proto: https | X-Forwarded-Proto: https | ||||
X-Original-Uri: /iRony/ | X-Original-Uri: /iRony/ | ||||
X-Real-Ip: 31.10.153.58 | X-Real-Ip: 31.10.153.58 | ||||
*/ | */ | ||||
$username = $this->normalizeUsername($request->headers->get('Php-Auth-User', "")); | $username = $this->normalizeUsername($request->headers->get('Php-Auth-User', "")); | ||||
$password = $request->headers->get('Php-Auth-Pw', null); | $password = $request->headers->get('Php-Auth-Pw', null); | ||||
if (empty($username)) { | |||||
//Allow unauthenticated requests | |||||
return response(""); | |||||
} | |||||
if (empty($password)) { | if (empty($password)) { | ||||
\Log::debug("Authentication attempt failed: Empty password provided."); | \Log::debug("Authentication attempt failed: Empty password provided."); | ||||
return response("", 401); | return response("", 401); | ||||
} | } | ||||
try { | try { | ||||
$this->authorizeRequest( | $this->authorizeRequest( | ||||
$username, | $username, | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |