Include WWW-Authenticate header with 401 response
This commit is contained in:
parent
34095f8edc
commit
5d58abf1e5
2
auth.php
2
auth.php
@ -45,6 +45,7 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('headless'))
|
|||||||
// not authenticated and username not submited
|
// not authenticated and username not submited
|
||||||
// load form
|
// load form
|
||||||
if (defined('headless')) {
|
if (defined('headless')) {
|
||||||
|
header('WWW-Authenticate: OAuth realm="users@ulogger"');
|
||||||
header('HTTP/1.1 401 Unauthorized', true, 401);
|
header('HTTP/1.1 401 Unauthorized', true, 401);
|
||||||
} else {
|
} else {
|
||||||
print
|
print
|
||||||
@ -115,6 +116,7 @@ if (!$user->isValid && (uConfig::$require_authentication || defined('headless'))
|
|||||||
}
|
}
|
||||||
session_destroy();
|
session_destroy();
|
||||||
if (defined('headless')) {
|
if (defined('headless')) {
|
||||||
|
header('WWW-Authenticate: OAuth realm="users@ulogger"');
|
||||||
header('HTTP/1.1 401 Unauthorized', true, 401);
|
header('HTTP/1.1 401 Unauthorized', true, 401);
|
||||||
} else {
|
} else {
|
||||||
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
$url = str_replace("//", "/", $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']) . "/index.php");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user