logifurture wip
This commit is contained in:
1 parent
99b901009c
commit
a96abae35a
15 files changed
+2143
-1518
No files matched your search
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Grapper\Logifuture;
|
||||
|
||||
class Auth
|
||||
{
|
||||
public static $pass = 'nuhodds';
|
||||
|
||||
public static function exe()
|
||||
{
|
||||
$base_url = BaseUrl::get();
|
||||
|
||||
$url = $base_url.'/v1/authentication/token';
|
||||
|
||||
$data = Loader::curlLoader($url, [
|
||||
'header' => [
|
||||
'accept: application/json',
|
||||
'content-type: application/json',
|
||||
],
|
||||
'post' => [
|
||||
'username' => 'nuhodds',
|
||||
'password' => self::$pass,
|
||||
],
|
||||
]);
|
||||
|
||||
if (! is_array($data)) {
|
||||
|
||||
Notice::note('no data sleep(60)', 'r');
|
||||
sleep(60);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$header = $data;
|
||||
$header[] = 'Authorization: Bearer '.$data['token'];
|
||||
$header[] = 'accept: application/json';
|
||||
$header[] = 'content-type: application/json';
|
||||
|
||||
return $header;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user