übergang auf pakete, integration von stripe und paypal, blog hinzugefügt.
This commit is contained in:
@@ -26,7 +26,7 @@ class LoginRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'string', 'email'],
|
||||
'login' => ['required', 'string'],
|
||||
'password' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
@@ -40,11 +40,14 @@ class LoginRequest extends FormRequest
|
||||
{
|
||||
$this->ensureIsNotRateLimited();
|
||||
|
||||
if (! Auth::attempt($this->only('email', 'password'), $this->boolean('remember'))) {
|
||||
$credentials = $this->only('login', 'password');
|
||||
$credentials['login'] = $this->input('login');
|
||||
|
||||
if (! Auth::attempt($credentials, $this->boolean('remember'))) {
|
||||
RateLimiter::hit($this->throttleKey());
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'email' => __('auth.failed'),
|
||||
'login' => __('auth.failed'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -79,7 +82,7 @@ class LoginRequest extends FormRequest
|
||||
*/
|
||||
public function throttleKey(): string
|
||||
{
|
||||
return $this->string('email')
|
||||
return $this->string('login')
|
||||
->lower()
|
||||
->append('|'.$this->ip())
|
||||
->transliterate()
|
||||
|
||||
Reference in New Issue
Block a user