File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,8 @@ public function once(array $credentials = [])
253
253
$ this ->fireAttemptEvent ($ credentials );
254
254
255
255
if ($ this ->validate ($ credentials )) {
256
+ $ this ->rehashPasswordIfRequired ($ this ->lastAttempted , $ credentials );
257
+
256
258
$ this ->setUser ($ this ->lastAttempted );
257
259
258
260
return true ;
Original file line number Diff line number Diff line change @@ -623,6 +623,7 @@ public function testLoginOnceSetsUser()
623
623
});
624
624
$ guard ->getProvider ()->shouldReceive ('retrieveByCredentials ' )->once ()->with (['foo ' ])->andReturn ($ user );
625
625
$ guard ->getProvider ()->shouldReceive ('validateCredentials ' )->once ()->with ($ user , ['foo ' ])->andReturn (true );
626
+ $ guard ->getProvider ()->shouldReceive ('rehashPasswordIfRequired ' )->with ($ user , ['foo ' ])->once ();
626
627
$ guard ->shouldReceive ('setUser ' )->once ()->with ($ user );
627
628
$ this ->assertTrue ($ guard ->once (['foo ' ]));
628
629
}
@@ -637,6 +638,7 @@ public function testLoginOnceFailure()
637
638
});
638
639
$ guard ->getProvider ()->shouldReceive ('retrieveByCredentials ' )->once ()->with (['foo ' ])->andReturn ($ user );
639
640
$ guard ->getProvider ()->shouldReceive ('validateCredentials ' )->once ()->with ($ user , ['foo ' ])->andReturn (false );
641
+ $ guard ->getProvider ()->shouldNotReceive ('rehashPasswordIfRequired ' );
640
642
$ this ->assertFalse ($ guard ->once (['foo ' ]));
641
643
}
642
644
You can’t perform that action at this time.
0 commit comments