Added url with capabilties

This commit is contained in:
Jeroen De Meerleer 2023-03-20 19:16:03 +01:00
parent 32f0dad639
commit 677eba19b5
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@
use Illuminate\Http\Client\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Js;
class InfoController extends Controller
{
@ -12,4 +13,9 @@ public function info(): JsonResponse
{
return new JsonResponse(['User' => Auth::user()]);
}
public function capabilities(): JsonResponse
{
return new JsonResponse(['login' => true, 'register' => true, 'reset' => true]);
}
}

View File

@ -19,11 +19,11 @@
'allowed_methods' => ['*'],
'allowed_origins' => [env('FRONTEND_URL', 'http://localhost:3000')],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'allowed_headers' => ['X-BlackbirdChessClient'],
'exposed_headers' => [],

View File

@ -13,6 +13,7 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Route::get('/capabilities', [App\Http\Controllers\InfoController::class, 'capabilities']);
Route::middleware(['auth:sanctum'])->get('/user', function (Request $request) {
return $request->user();