Skip to content

Commit f88dd2d

Browse files
committed
fixed user existence check
1 parent 95cfec2 commit f88dd2d

File tree

1 file changed

+1
-1
lines changed
  • phpslim-api/homedocs/Middleware

1 file changed

+1
-1
lines changed

phpslim-api/homedocs/Middleware/JWT.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __invoke(\Psr\Http\Message\ServerRequestInterface $request, \Psr
3636
if (isset($decoded) && isset($decoded->data) && isset($decoded->data->userId) && isset($decoded->data->email)) {
3737
$this->logger->notice("JWT valid data decoded", [print_r($decoded->data, true)]);
3838
$user = new \HomeDocs\User($decoded->data->userId);
39-
if (!$user->exists($this->dbh)) {
39+
if ($user->exists($this->dbh)) {
4040
\HomeDocs\UserSession::set($decoded->data->userId, $decoded->data->email);
4141
} else {
4242
throw new \HomeDocs\Exception\NotFoundException("userId");

0 commit comments

Comments
 (0)