@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | $http_origin = $_SERVER['HTTP_ORIGIN']; |
| 4 | -if ($http_origin == "http://localhost:8080" || $http_origin == "https://minska.eliareutlinger.ch"){ |
|
| 4 | +if ($http_origin == "http://localhost:8080" || $http_origin == "https://minska.eliareutlinger.ch") { |
|
| 5 | 5 | header("Access-Control-Allow-Origin: $http_origin"); |
| 6 | 6 | } |
| 7 | 7 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $domain = ".eliareutlinger.ch"; |
| 52 | 52 | //$domain = "localhost"; |
| 53 | 53 | $expire = $token_conf['expireAt']; |
| 54 | - if(isset($_SERVER['HTTPS'])){ |
|
| 54 | + if (isset($_SERVER['HTTPS'])) { |
|
| 55 | 55 | $secure = "Secure"; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -3,6 +3,6 @@ |
||
| 3 | 3 | include_once '../../_config/headers.php'; |
| 4 | 4 | include_once '../../_config/core.php'; |
| 5 | 5 | |
| 6 | -$expire = time()-50; |
|
| 6 | +$expire = time() - 50; |
|
| 7 | 7 | header("Set-Cookie: secureToken=null; Dexpires=$expire; Path=/; samesite=strict; httpOnly; $secure"); |
| 8 | 8 | returnSuccess($jwt); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | list($type, $data) = explode(" ", getallheaders()['Authorization'], 2); |
| 21 | 21 | if (strcasecmp($type, "Bearer") == 0) { |
| 22 | 22 | |
| 23 | - if($_COOKIE["appToken"] === $data){ |
|
| 23 | + if ($_COOKIE["appToken"] === $data) { |
|
| 24 | 24 | return $_COOKIE["appToken"]; |
| 25 | 25 | } else { |
| 26 | 26 | returnForbidden("Tokens not correct"); |