-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoauth.php
More file actions
34 lines (21 loc) · 752 Bytes
/
oauth.php
File metadata and controls
34 lines (21 loc) · 752 Bytes
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
32
33
34
<?php
include_once "include/include.php";
# Check if the request is of type Post
if ($_SERVER["REQUEST_METHOD"] == "POST") {
# Get the APP-ID out of the Session superglobal
$appid = $_SESSION['appid'];
$username = test_input($_POST["username"]);
$password = test_input($_POST["password"]);
echo "APPID: " . $appid;
include "functions/login.php";
if (isset($appid)) {
$resp = hashlogin($appid, $username, $password);
if (!$resp) {
echo "<script>console.log('Login-Failed (Response False)');</script>";
die();
}
$redirecturl = $resp->{'redirect-url'};
$temphash = $resp->{'temphash'};
header("Location: " . $redirecturl . $temphash);
}
}