@if(Route::has('password.request'))
-
diff --git a/tests/Actions/AuthenticateUserTest.php b/tests/Actions/AuthenticateUserTest.php
index a332bbf..c1cadd1 100644
--- a/tests/Actions/AuthenticateUserTest.php
+++ b/tests/Actions/AuthenticateUserTest.php
@@ -24,6 +24,7 @@
$this->assertNotNull($loggedUser);
$this->assertTrue($user->is($loggedUser));
+ $this->assertFalse($request->filled('remember'));
});
it('login the user by the email when alt username is set', function () {
@@ -44,6 +45,7 @@
$this->assertNotNull($loggedUser);
$this->assertTrue($user->is($loggedUser));
+ $this->assertFalse($request->filled('remember'));
});
it('login the user by the alt username (username)', function () {
@@ -64,6 +66,7 @@
$this->assertNotNull($loggedUser);
$this->assertTrue($user->is($loggedUser));
+ $this->assertFalse($request->filled('remember'));
});
it('doesnt login the user by the alt username if not set (username)', function () {
@@ -83,6 +86,7 @@
$loggedUser = $authenticator->handle();
$this->assertNull($loggedUser);
+ $this->assertFalse($request->filled('remember'));
});
it('doesnt login the user if password is incorrect', function () {
@@ -102,3 +106,28 @@
$this->assertNull($loggedUser);
});
+
+it('should handle the remember me checkbox', function () {
+ Config::set('fortify.models.user', \ARKEcosystem\Fortify\Models\User::class);
+ Config::set('fortify.username_alt', 'username');
+
+ $user = User::factory()->withUsername()->create();
+
+ $request = new Request();
+
+ $this->assertFalse($request->filled('remember'));
+
+ $request->replace([
+ 'email' => $user->username,
+ 'password' => 'password',
+ 'remember' => true,
+ ]);
+
+ $authenticator = new AuthenticateUser($request);
+ $loggedUser = $authenticator->handle();
+
+ $this->assertNotNull($loggedUser);
+ $this->assertTrue($user->is($loggedUser));
+
+ $this->assertTrue($request->filled('remember'));
+});