Implemented storage of authentication token in database and cookies (latter are isolated per domain)

This commit is contained in:
djpbessems
2019-01-28 11:48:05 +01:00
parent ef4c97a784
commit 0c8b672b41
4 changed files with 51 additions and 39 deletions

View File

@ -18,7 +18,6 @@
// For debugging purposes - enable it in ../lucidAuth.config.php
if ($settings->Debug['LogToFile']) {
file_put_contents('../requestHeaders.log', (new DateTime())->format('Y-m-d\TH:i:s.u') . ' --- ' . (json_encode($proxyHeaders, JSON_FORCE_OBJECT)) . PHP_EOL, FILE_APPEND);
file_put_contents('../requestHeaders.log', (new DateTime())->format('Y-m-d\TH:i:s.u') . ' --+ ' . (base64_encode(json_encode($proxyHeaders))) . PHP_EOL, FILE_APPEND);
}
# if (sizeof($proxyHeaders) == 0) {
@ -28,9 +27,7 @@
exit;
}
if (!empty($_COOKIE['JWT']) && validateToken([
'JWT' => $_COOKIE['JWT']
])['status'] == "Success") {
if (!empty($_COOKIE['JWT']) && validateToken($_COOKIE['JWT'])['status'] == "Success") {
// Valid authentication token found
header("HTTP/1.1 202 Accepted");
exit;