api ендпоинты для аутентификации

This commit is contained in:
vasya
2026-03-14 20:35:45 +03:00
parent 681cfc7cad
commit 20715e880f
+29
View File
@@ -0,0 +1,29 @@
<?php
use Illuminate\Http\Request;
use \App\Http\Controllers;
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
#Гаврилов
//РОУТ НИЖЕ НУЖЕН? НЕ ПОМНЮ ОТКУДА ОН ВЗЯЛСЯ. Пока оставляю, но надо разобраться для теста он или нужен на проде
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
/**
* Получение пользовательской роли
*/
Route::get('user_role/{moduleName}', [Controllers\AuthorizationController::class, 'getUserRole'])->where('moduleName', '^[a-z0-9_]+$');