@@ -68,29 +68,23 @@ the user::
68
68
}
69
69
}
70
70
71
- if ($isPasswordValid) {
72
- $currentHour = date('G');
73
- if ($currentHour < 14 || $currentHour > 16) {
74
- // CAUTION: this message will be returned to the client
75
- // (so don't put any un-trusted messages / error strings here)
76
- throw new CustomUserMessageAuthenticationException(
77
- 'You can only log in between 2 and 4!',
78
- array(), // Message Data
79
- 412 // HTTP 412 Precondition Failed
80
- );
81
- }
82
-
83
- return new UsernamePasswordToken(
84
- $user,
85
- $user->getPassword(),
86
- $providerKey,
87
- $user->getRoles()
71
+ $currentHour = date('G');
72
+ if ($currentHour < 14 || $currentHour > 16) {
73
+ // CAUTION: this message will be returned to the client
74
+ // (so don't put any un-trusted messages / error strings here)
75
+ throw new CustomUserMessageAuthenticationException(
76
+ 'You can only log in between 2 and 4!',
77
+ array(), // Message Data
78
+ 412 // HTTP 412 Precondition Failed
88
79
);
89
80
}
90
81
91
- // CAUTION: this message will be returned to the client
92
- // (so don't put any un-trusted messages / error strings here)
93
- throw new CustomUserMessageAuthenticationException('Invalid username or password');
82
+ return new UsernamePasswordToken(
83
+ $user,
84
+ $user->getPassword(),
85
+ $providerKey,
86
+ $user->getRoles()
87
+ );
94
88
}
95
89
96
90
public function supportsToken(TokenInterface $token, $providerKey)
0 commit comments