2024-03-07 19:04:52 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
2024-05-13 20:06:05 +02:00
|
|
|
use App\Interfaces\MemberRepositoryInterface;
|
2024-03-07 19:04:52 +01:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
|
|
|
|
class AuthAPIController extends Controller
|
|
|
|
{
|
2024-05-13 20:06:05 +02:00
|
|
|
protected $member;
|
|
|
|
|
2024-03-07 19:04:52 +01:00
|
|
|
public function __construct(
|
2024-05-13 20:06:05 +02:00
|
|
|
MemberRepositoryInterface $memberRepo
|
2024-03-07 19:04:52 +01:00
|
|
|
) {
|
2024-05-13 20:06:05 +02:00
|
|
|
$this->member = $memberRepo;
|
2024-03-07 19:04:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function status(Request $request)
|
|
|
|
{
|
|
|
|
$result = [];
|
|
|
|
$data = json_decode($request->getContent());
|
2024-05-13 20:06:05 +02:00
|
|
|
if ($this->member::status()) {
|
2024-03-07 19:04:52 +01:00
|
|
|
$result = [
|
|
|
|
'message' => 'Authorized',
|
|
|
|
'type' => 'apiUseAuthorized',
|
|
|
|
'token' => session('token'),
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
$result = [
|
|
|
|
'message' => 'Not Authorized',
|
|
|
|
'type' => 'apiUseNotAuthorized',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
return response()->json($result);
|
|
|
|
}
|
|
|
|
}
|