Skip to content

Commit

Permalink
Merge branch '1.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
agungsugiarto committed Oct 15, 2022
2 parents a4206f3 + 74e5826 commit 43c2882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
use CodeIgniter\View\RendererInterface;
use Fluent\Auth\Facades\Auth;
use Fluent\Auth\Facades\RateLimiter;
use Fluent\Auth\Helpers\Str;

use function func_get_args;
use function is_array;
use function is_bool;
use function strtolower;
use function trim;

class AuthenticatedSessionController extends BaseController
Expand Down Expand Up @@ -136,6 +134,6 @@ protected function isEmptyString($key)
*/
public function throttleKey()
{
return strtolower(Str::extractName($this->request->getPost('email'))) . '_' . str_replace("::", "", $this->request->getIPAddress());
return md5("{$this->request->getPost('email')}|{$this->request->getIPAddress()}");
}
}
4 changes: 1 addition & 3 deletions src/Filters/ThrottleFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\Response;
use CodeIgniter\HTTP\ResponseInterface;
use Fluent\Auth\Facades\Auth;
use Fluent\Auth\Facades\RateLimiter;
use Fluent\Auth\Helpers\Str;

use function array_values;

Expand Down Expand Up @@ -88,6 +86,6 @@ protected function decaySecond(array $arguments)
*/
public function throttleKey(RequestInterface $request)
{
return 'throttle_' . Str::extractName(Auth::user()->email) . '_' . str_replace("::", "", $request->getIPAddress());
return 'throttle_' . md5(auth()->user()->email . "|{$request->getIPAddress()}");
}
}

0 comments on commit 43c2882

Please sign in to comment.