Skip to content

Commit

Permalink
wip whitelisting
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim-the-Diamond committed Sep 9, 2024
1 parent 1f7f80c commit fe7d484
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 150 deletions.
37 changes: 19 additions & 18 deletions packages/press/src/Services/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,27 @@

namespace Moox\Press\Services;

use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use Filament\Forms\Form;
use Jenssegers\Agent\Agent;
use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Facades\Filament;
use Filament\Pages\SimplePage;
use Filament\Actions\ActionGroup;
use Illuminate\Routing\Redirector;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Blade;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Component;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Http\Responses\Auth\Contracts\LoginResponse;
use Filament\Notifications\Notification;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Pages\SimplePage;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\HtmlString;
use Illuminate\Validation\ValidationException;
use Jenssegers\Agent\Agent;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Http\Responses\Auth\Contracts\LoginResponse;
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;

/**
* @property Form $form
Expand Down Expand Up @@ -79,11 +80,11 @@ protected function getLoginFormComponent(): Component
{
return
TextInput::make('login')
->label('Login')
->required()
->autocomplete()
->autofocus()
->extraInputAttributes(['tabindex' => 1]);
->label('Login')
->required()
->autocomplete()
->autofocus()
->extraInputAttributes(['tabindex' => 1]);
}

public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
Expand Down Expand Up @@ -163,7 +164,7 @@ public function authenticate(): Redirector|RedirectResponse|LoginResponse|null
$signature = hash_hmac('sha256', $payload, env('APP_KEY'));
$token = "{$payload}.{$signature}";

return redirect('https://'.$_SERVER['SERVER_NAME'].config('press.wordpress_slug').'/wp-login.php?auth_token='.$token);
return redirect('https://' . $_SERVER['SERVER_NAME'] . config('press.wordpress_slug') . '/wp-login.php?auth_token=' . $token);
} else {
return app(LoginResponse::class);
}
Expand Down
60 changes: 0 additions & 60 deletions packages/press/src/Services/WithRateLimiting.php

This file was deleted.

25 changes: 13 additions & 12 deletions packages/user/src/Services/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@

namespace Moox\User\Services;

use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;
use Filament\Actions\ActionGroup;
use Filament\Forms\Form;
use Jenssegers\Agent\Agent;
use Filament\Facades\Filament;
use Filament\Pages\SimplePage;
use Filament\Actions\ActionGroup;
use Illuminate\Routing\Redirector;
use Illuminate\Support\HtmlString;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Blade;
use Filament\Forms\Components\Checkbox;
use Filament\Forms\Components\Component;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Http\Responses\Auth\Contracts\LoginResponse;
use Filament\Notifications\Notification;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Pages\SimplePage;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Http\RedirectResponse;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\HtmlString;
use Illuminate\Validation\ValidationException;
use Jenssegers\Agent\Agent;
use DanHarrin\LivewireRateLimiting\WithRateLimiting;
use Filament\Pages\Concerns\InteractsWithFormActions;
use Filament\Http\Responses\Auth\Contracts\LoginResponse;
use DanHarrin\LivewireRateLimiting\Exceptions\TooManyRequestsException;

/**
* @property Form $form
Expand Down
60 changes: 0 additions & 60 deletions packages/user/src/Services/WithRateLimiting.php

This file was deleted.

0 comments on commit fe7d484

Please sign in to comment.