Skip to content

Commit

Permalink
Revert "[10.x] Remove session on authenticatable deletion v2 (#47141)" (
Browse files Browse the repository at this point in the history
#47354)

This reverts commit 8fe2f65.
  • Loading branch information
taylorotwell authored Jun 5, 2023
1 parent 6ba1b83 commit 3611242
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/Illuminate/Auth/SessionGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@ public function user()
}
}

if (is_null($this->user)) {
$this->clearUserDataFromStorage();
}

return $this->user;
}

Expand Down
6 changes: 0 additions & 6 deletions tests/Auth/AuthGuardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,6 @@ public function testAuthenticateThrowsWhenUserIsNull()
$this->expectExceptionMessage('Unauthenticated.');

$guard = $this->getGuard();
$guard->setCookieJar($cookies = m::mock(CookieJar::class));
$cookies->shouldReceive('unqueue')->once();
$guard->getSession()->shouldReceive('remove')->once();
$guard->getSession()->shouldReceive('get')->once()->andReturn(null);

$guard->authenticate();
Expand Down Expand Up @@ -316,9 +313,6 @@ public function testUserMethodReturnsCachedUser()
public function testNullIsReturnedForUserIfNoUserFound()
{
$mock = $this->getGuard();
$mock->setCookieJar($cookies = m::mock(CookieJar::class));
$cookies->shouldReceive('unqueue')->once();
$mock->getSession()->shouldReceive('remove')->once();
$mock->getSession()->shouldReceive('get')->once()->andReturn(null);
$this->assertNull($mock->user());
}
Expand Down

0 comments on commit 3611242

Please sign in to comment.