refactored some routes

This commit is contained in:
2024-07-14 10:58:05 +00:00
parent e482a700f4
commit 2246f18d07
2 changed files with 14 additions and 17 deletions

View File

@@ -51,10 +51,6 @@ Route::middleware('auth')->group(function () {
// });
// Route::post('technotransport2022', 'TechnoTransportController@addTechnoTransport');
// Route::get('csrf', function () {
// Auth::loginUsingId(1156);
// return csrf_token();
// });
// /// project list begin
@@ -814,10 +810,6 @@ Route::post('webapi/cmms/search', 'Api\CMMSController@search');
// Route::get('webapi/randd/voting/{id}/result', 'Api\RandDVoting\VoterController@showResult');
// Route::post('webapi/randd/voting/{id}/end', 'Api\RandDVoting\AdminVoterController@endVoting');
// Route::post('webapi/request', function (Illuminate\Http\Request $request) {
// return $request->all();
// });
// Route::get('create_temp_role', function () {
// return Auth::loginUsingId(469);
// // User::find(1069)->assignRole('RandD');
@@ -986,10 +978,6 @@ Route::middleware('web', 'auth', 'confirmUser')->group(function () {
// Route::get("milaaaaad", 'PostersController@develooooooo0p');
// // Route::get('dev_csrffff', function(){
// // auth()->loginUsingId(User::where('username', 'witel')->first()->id);
// // // return csrf_token();
// // });
// //road observation begin 1401
@@ -1504,13 +1492,22 @@ Route::get('/', function () {
// return 'ok';
// });
// CAUTION: DON'T DISABLE CORS POLICY
Route::get('csrf', function () {
return response()->json([
'data' => csrf_token()
]);
});
if (config('global_variables.IS_DEVELOPMENT_ENV') === true) {
Route::get('login_dev', function (Request $request) {
$request->validate([
'username' => 'required',
]);
Auth::loginUsingId(User::where('username', $request->username)->first()->id);
});
}
}