Skip to content

Commit 911c23a

Browse files
committedApr 24, 2014
.
1 parent 667949f commit 911c23a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎EventListener/LatchListener.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ public function __construct($container)
2222
public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
2323
{
2424
$user = $event->getAuthenticationToken()->getUser();
25-
if (!empty($user->getLatch())) {
25+
$latchValue = $user->getLatch();
26+
if ($latchValue != '') {
2627
$appId = $this->container->getParameter('latch_app_id');
27-
$appSecret = $this->container->getParameter('latch_app_secret');
28+
$appSecret = $this->container->getParameter('latch_app_secret');
2829
$api = new Latch($appId, $appSecret);
2930
$statusResponse = $api->status($user->getLatch());
3031
if ($statusResponse->getError() === null) {
@@ -35,7 +36,7 @@ public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
3536
} else {
3637
$this->container->get('security.context')->setToken(null);
3738
$this->container->get('request')->getSession()->invalidate();
38-
}
39-
}
39+
}
40+
}
4041
}
4142
}

0 commit comments

Comments
 (0)
Please sign in to comment.