its still password123

This commit is contained in:
red 2025-12-05 13:50:04 +00:00
parent ea5842d292
commit 9f58cf209f
3 changed files with 13 additions and 4 deletions

View File

@ -10,7 +10,8 @@ class ParticipantController extends Controller
{ {
public static function createFromToken(Request $request, string $id) public static function createFromToken(Request $request, string $id)
{ {
if ($request->input('password') !== 'password123') { if ($request->input('password') !== env('ADMIN_PASSWORD')) {
Log::info(env('ADMIN_PASSWORD'));
return response()->json(['message' => 'Unauthorized: Wrong password'], 401); return response()->json(['message' => 'Unauthorized: Wrong password'], 401);
} }

View File

@ -5,9 +5,15 @@ use App\Services\MatcherService;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use function Livewire\Volt\{state, mount}; use function Livewire\Volt\{state, mount};
state(['participants' => Collection::class]); state(['participants' => Collection::class,
'render' => false]);
state(['password']);
mount(function () { mount(function ($password) {
$this->password = $password;
if ($this->password == env('ADMIN_PASSWORD')) {
$this->render = true;
}
$this->participants = Participant::all(); $this->participants = Participant::all();
}); });
@ -22,6 +28,7 @@ $runMatch = function () {
?> ?>
<div class="p-6 bg-gray-100 min-h-screen"> <div class="p-6 bg-gray-100 min-h-screen">
@if($render)
<div class="max-w-7xl mx-auto"> <div class="max-w-7xl mx-auto">
<div class="flex justify-between items-center mb-6"> <div class="flex justify-between items-center mb-6">
@ -102,4 +109,5 @@ $runMatch = function () {
</table> </table>
</div> </div>
@endif @endif
@endif
</div> </div>

View File

@ -8,6 +8,6 @@ Route::get('/', function () {
})->name('home'); })->name('home');
Volt::route('start', 'pages.start')->name('start'); Volt::route('start', 'pages.start')->name('start');
Volt::route('table', 'pages.table')->name('table'); Volt::route('table/{password}', 'pages.table')->name('table');
Volt::route('profile/{token}', 'pages.profile')->name('profile'); Volt::route('profile/{token}', 'pages.profile')->name('profile');
Volt::route('withdraw/{token}', 'pages.withdraw')->name('withdraw'); Volt::route('withdraw/{token}', 'pages.withdraw')->name('withdraw');