AdminLogoutObserver.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Refer to LICENSE.txt distributed with the Temando Shipping module for notice of license
  4. */
  5. namespace Temando\Shipping\Observer;
  6. use Magento\Framework\Event\Observer;
  7. use Magento\Framework\Event\ObserverInterface;
  8. use Temando\Shipping\Rest\AuthenticationInterface;
  9. /**
  10. * Temando Logout Observer
  11. *
  12. * @package Temando\Shipping\Observer
  13. * @author Sebastian Ertner <sebastian.ertner@netresearch.de>
  14. * @author Christoph Aßmann <christoph.assmann@netresearch.de>
  15. * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  16. * @link https://www.temando.com/
  17. */
  18. class AdminLogoutObserver implements ObserverInterface
  19. {
  20. /**
  21. * @var AuthenticationInterface
  22. */
  23. private $auth;
  24. /**
  25. * AdminLogoutObserver constructor.
  26. * @param AuthenticationInterface $auth
  27. */
  28. public function __construct(AuthenticationInterface $auth)
  29. {
  30. $this->auth = $auth;
  31. }
  32. /**
  33. * @param Observer $observer
  34. * @return void
  35. */
  36. public function execute(Observer $observer)
  37. {
  38. $this->auth->disconnect();
  39. }
  40. }