You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
973 B
PHP
28 lines
973 B
PHP
<?php
|
|
|
|
use App\Http\Controllers\api\AuthController;
|
|
use App\Http\Middleware\Cors;
|
|
use App\Http\Middleware\UserAuthMiddleware;
|
|
use Illuminate\Http\Request;
|
|
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!
|
|
|
|
|
*/
|
|
const USER_MIDDLEWARES = ['auth:sanctum', UserAuthMiddleware::class];
|
|
Route::controller(AuthController::class )->group(function() {
|
|
Route::post('/login', 'login');
|
|
Route::middleware(USER_MIDDLEWARES)->group(function() {
|
|
Route::post('/auth/check', 'check');
|
|
Route::post('/auth/change-password', 'changePassword');
|
|
Route::post('/auth/logout', 'logout');
|
|
});
|
|
});
|