its still password123
This commit is contained in:
parent
ea5842d292
commit
9f58cf209f
|
|
@ -10,7 +10,8 @@ class ParticipantController extends Controller
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,15 @@ use App\Services\MatcherService;
|
|||
use Illuminate\Database\Eloquent\Collection;
|
||||
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();
|
||||
});
|
||||
|
||||
|
|
@ -22,6 +28,7 @@ $runMatch = function () {
|
|||
?>
|
||||
|
||||
<div class="p-6 bg-gray-100 min-h-screen">
|
||||
@if($render)
|
||||
<div class="max-w-7xl mx-auto">
|
||||
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
|
|
@ -102,4 +109,5 @@ $runMatch = function () {
|
|||
</table>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,6 @@ Route::get('/', function () {
|
|||
})->name('home');
|
||||
|
||||
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('withdraw/{token}', 'pages.withdraw')->name('withdraw');
|
||||
|
|
|
|||
Loading…
Reference in New Issue