-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathauth.php
31 lines (25 loc) · 936 Bytes
/
auth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$code = $_REQUEST["code"];
$state = $_REQUEST["state"];
$host = $_SERVER["HTTP_HOST"];
$redirect = match ($host) {
"www.coronacheck.nl" => "https://status.coronacheck.nl/app/auth.php",
"coronacheck.nl" => "https://status.coronacheck.nl/app/auth.php",
default => null,
};
$redirectFullUrl = $redirect . "?code=".rawurlencode($code) . "&state=" . rawurlencode($state);
http_response_code(302);
header("Location: ".$redirectFullUrl);
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CoronaCheck Redirect</title>
<meta http-equiv="refresh" content="0;URL='<?php echo $redirectFullUrl; ?>'" />
</head>
<body>
<p>Open the CoronaCheck App: <a href="<?php echo $redirectFullUrl; ?>"><?php echo $redirectFullUrl; ?></a>.</p>
</body>
</html>