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 14
14
use Symfony \Component \Security \Core \Authentication \Token \SwitchUserToken ;
15
15
use Symfony \Component \Security \Core \Authentication \Token \TokenInterface ;
16
16
use Symfony \Component \Security \Core \Authentication \Token \UsernamePasswordToken ;
17
+ use Symfony \Component \Security \Core \Exception \AccountStatusException ;
17
18
use Symfony \Component \Security \Core \Exception \AuthenticationException ;
18
19
use Symfony \Component \Security \Core \Exception \AuthenticationServiceException ;
19
20
use Symfony \Component \Security \Core \Exception \BadCredentialsException ;
@@ -79,7 +80,7 @@ public function authenticate(TokenInterface $token)
79
80
$ this ->userChecker ->checkPreAuth ($ user );
80
81
$ this ->checkAuthentication ($ user , $ token );
81
82
$ this ->userChecker ->checkPostAuth ($ user );
82
- } catch (BadCredentialsException $ e ) {
83
+ } catch (AccountStatusException $ e ) {
83
84
if ($ this ->hideUserNotFoundExceptions ) {
84
85
throw new BadCredentialsException ('Bad credentials. ' , 0 , $ e );
85
86
}
Original file line number Diff line number Diff line change 70
70
<source >Invalid or expired login link.</source >
71
71
<target >Virheellinen tai vanhentunut kirjautumislinkki.</target >
72
72
</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 >
73
81
</body >
74
82
</file >
75
83
</xliff >
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
82
82
83
83
public function testAuthenticateWhenPreChecksFails ()
84
84
{
85
- $ this ->expectException (CredentialsExpiredException ::class);
85
+ $ this ->expectException (BadCredentialsException ::class);
86
86
$ userChecker = $ this ->createMock (UserCheckerInterface::class);
87
87
$ userChecker ->expects ($ this ->once ())
88
88
->method ('checkPreAuth ' )
@@ -100,7 +100,7 @@ public function testAuthenticateWhenPreChecksFails()
100
100
101
101
public function testAuthenticateWhenPostChecksFails ()
102
102
{
103
- $ this ->expectException (AccountExpiredException ::class);
103
+ $ this ->expectException (BadCredentialsException ::class);
104
104
$ userChecker = $ this ->createMock (UserCheckerInterface::class);
105
105
$ userChecker ->expects ($ this ->once ())
106
106
->method ('checkPostAuth ' )
@@ -127,7 +127,7 @@ public function testAuthenticateWhenPostCheckAuthenticationFails()
127
127
;
128
128
$ provider ->expects ($ this ->once ())
129
129
->method ('checkAuthentication ' )
130
- ->willThrowException (new BadCredentialsException ())
130
+ ->willThrowException (new CredentialsExpiredException ())
131
131
;
132
132
133
133
$ provider ->authenticate ($ this ->getSupportedToken ());
You can’t perform that action at this time.
0 commit comments