Skip to content

Commit

Permalink
Hotfix Login dead when Server offline
Browse files Browse the repository at this point in the history
  • Loading branch information
Galileon-venta committed Nov 12, 2020
1 parent 62ffa48 commit 87bee9d
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/ventAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ public function ventAPI_login($username,$password){
global $http;
$credentials['username'] = $username;
$credentials['password'] = $password;
$response = $this->http->request('POST','http://ventagaming.de:9090/api/auth/token',
[
'body' => json_encode($credentials)
,
'headers' => [
'Content-Type' => 'application/json',
'Accept' => '*/*',
]
]);
$_SESSION['ventAPItoken'] = $response->getBody();
try {
$response = $this->http->request('POST', 'http://ventagaming.de:9090/api/auth/token',
[
'body' => json_encode($credentials)
,
'headers' => [
'Content-Type' => 'application/json',
'Accept' => '*/*',
]
]);
$_SESSION['ventAPItoken'] = $response->getBody();
}
catch (Exception $e){
error_log("Can't Authenticate; API is offline");
}
}

private function get_secure($url){
Expand Down

0 comments on commit 87bee9d

Please sign in to comment.