| @@ 28-40 (lines=13) @@ | ||
| 25 | $this->userService = $userService; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function checkPreAuth(UserInterface $user): void |
|
| 29 | { |
|
| 30 | if (!$user instanceof EzUserInterface) { |
|
| 31 | return; |
|
| 32 | } |
|
| 33 | ||
| 34 | if (!$user->getAPIUser()->enabled) { |
|
| 35 | $exception = new DisabledException('User account is locked.'); |
|
| 36 | $exception->setUser($user); |
|
| 37 | ||
| 38 | throw $exception; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| 42 | public function checkPostAuth(UserInterface $user): void |
|
| 43 | { |
|
| @@ 42-54 (lines=13) @@ | ||
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| 42 | public function checkPostAuth(UserInterface $user): void |
|
| 43 | { |
|
| 44 | if (!$user instanceof EzUserInterface) { |
|
| 45 | return; |
|
| 46 | } |
|
| 47 | ||
| 48 | if ($this->userService->getPasswordInfo($user->getAPIUser())->isPasswordExpired()) { |
|
| 49 | $exception = new CredentialsExpiredException('User account has expired.'); |
|
| 50 | $exception->setUser($user); |
|
| 51 | ||
| 52 | throw $exception; |
|
| 53 | } |
|
| 54 | } |
|
| 55 | } |
|
| 56 | ||