Skip to content

Commit

Permalink
Fixed null var reference (#24)
Browse files Browse the repository at this point in the history
Fixed null var reference
Fixed Session check against `Session` instance
  • Loading branch information
marcoalbarelli authored Jan 20, 2019
1 parent d60e350 commit e4a65d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Controller/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function loginAction(Request $request)
public function acsAction(Request $request)
{
if ($this->sp->isAuthenticated()) {
return ['attributes' => $sp->getAttributes()];
return ['attributes' => $this->sp->getAttributes()];
}
return new Response("Unauthenticated", 401);
}
Expand All @@ -79,4 +79,4 @@ public function singleLogoutAction(Request $request)
{
throw new \Exception('Uninmplemented');
}
}
}
7 changes: 3 additions & 4 deletions Security/SpidAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ public function supportsRememberMe()
public function supports(Request $request): bool
{
if (!isset($_SESSION['spidSession']) ||
!($_SESSION['spidSession'] instanceof Session) ||
!isset($_SESSION['spidSession']->idp) ||
!isset($_SESSION['spidSession']->level) ||
!isset($_SESSION['spidSession']->attributes)
!isset($_SESSION['spidSession']['idp']) ||
!isset($_SESSION['spidSession']['level']) ||
!isset($_SESSION['spidSession']['attributes'])
) {
return false;
} else {
Expand Down

0 comments on commit e4a65d5

Please sign in to comment.