mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-11 02:51:56 +00:00
(test for old input on failed login)
This commit is contained in:
@@ -16,7 +16,7 @@ class LoginController extends Controller
|
||||
public function login()
|
||||
{
|
||||
if (! Auth::attempt(request(['email', 'password']))) {
|
||||
return redirect('/login')->withErrors([
|
||||
return redirect('/login')->withInput(request(['email']))->withErrors([
|
||||
'email' => ['These credentials do not match our records.'],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ class PromoterLoginTest extends DuskTestCase
|
||||
->type('password', 'wrong-password')
|
||||
->press('Log in')
|
||||
->assertPathIs('/login')
|
||||
->assertInputValue('email', 'jane@example.com')
|
||||
->assertSee('credentials do not match');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ class PromoterLoginTest extends TestCase
|
||||
|
||||
$response->assertRedirect('/login');
|
||||
$response->assertSessionHasErrors('email');
|
||||
$this->assertTrue(session()->hasOldInput('email'));
|
||||
$this->assertFalse(session()->hasOldInput('password'));
|
||||
$this->assertFalse(Auth::check());
|
||||
}
|
||||
|
||||
@@ -63,6 +65,8 @@ class PromoterLoginTest extends TestCase
|
||||
|
||||
$response->assertRedirect('/login');
|
||||
$response->assertSessionHasErrors('email');
|
||||
$this->assertTrue(session()->hasOldInput('email'));
|
||||
$this->assertFalse(session()->hasOldInput('password'));
|
||||
$this->assertFalse(Auth::check());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user