File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
Tests/Authentication/Provider Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1414use Symfony \Component \Security \Core \Authentication \Token \SwitchUserToken ;
1515use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
1616use Symfony \Component \Security \Core \Authentication \Token \UsernamePasswordToken ;
17+ use Symfony \Component \Security \Core \Exception \AccountStatusException ;
1718use Symfony \Component \Security \Core \Exception \AuthenticationException ;
1819use Symfony \Component \Security \Core \Exception \AuthenticationServiceException ;
1920use Symfony \Component \Security \Core \Exception \BadCredentialsException ;
@@ -79,7 +80,7 @@ public function authenticate(TokenInterface $token)
7980 $ this ->userChecker ->checkPreAuth ($ user );
8081 $ this ->checkAuthentication ($ user , $ token );
8182 $ this ->userChecker ->checkPostAuth ($ user );
82- } catch (BadCredentialsException $ e ) {
83+ } catch (AccountStatusException $ e ) {
8384 if ($ this ->hideUserNotFoundExceptions ) {
8485 throw new BadCredentialsException ('Bad credentials. ' , 0 , $ e );
8586 }
Original file line number Diff line number Diff line change 7070 <source >Invalid or expired login link.</source >
7171 <target >Virheellinen tai vanhentunut kirjautumislinkki.</target >
7272 </trans-unit >
73+ <trans-unit id =" 19" >
74+ <source >Too many failed login attempts, please try again in %minutes% minute.</source >
75+ <target >Liian monta epäonnistunutta kirjautumisyritystä, yritä uudelleen %minutes% minuutin kuluttua.</target >
76+ </trans-unit >
77+ <trans-unit id =" 20" >
78+ <source >Too many failed login attempts, please try again in %minutes% minutes.</source >
79+ <target >Liian monta epäonnistunutta kirjautumisyritystä, yritä uudelleen %minutes% minuutin kuluttua.</target >
80+ </trans-unit >
7381 </body >
7482 </file >
7583</xliff >
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
8282
8383 public function testAuthenticateWhenPreChecksFails ()
8484 {
85- $ this ->expectException (CredentialsExpiredException ::class);
85+ $ this ->expectException (BadCredentialsException ::class);
8686 $ userChecker = $ this ->createMock (UserCheckerInterface::class);
8787 $ userChecker ->expects ($ this ->once ())
8888 ->method ('checkPreAuth ' )
@@ -100,7 +100,7 @@ public function testAuthenticateWhenPreChecksFails()
100100
101101 public function testAuthenticateWhenPostChecksFails ()
102102 {
103- $ this ->expectException (AccountExpiredException ::class);
103+ $ this ->expectException (BadCredentialsException ::class);
104104 $ userChecker = $ this ->createMock (UserCheckerInterface::class);
105105 $ userChecker ->expects ($ this ->once ())
106106 ->method ('checkPostAuth ' )
@@ -127,7 +127,7 @@ public function testAuthenticateWhenPostCheckAuthenticationFails()
127127 ;
128128 $ provider ->expects ($ this ->once ())
129129 ->method ('checkAuthentication ' )
130- ->willThrowException (new BadCredentialsException ())
130+ ->willThrowException (new CredentialsExpiredException ())
131131 ;
132132
133133 $ provider ->authenticate ($ this ->getSupportedToken ());
You can’t perform that action at this time.
0 commit comments