Beispiel #1
0
 public function checkAuth(Route $requestedRoute)
 {
     $auth = $this->authService->resume();
     if (!$auth->isValid()) {
         return $this->redirectRoute;
     }
     return $requestedRoute;
 }
Beispiel #2
0
 /**
  * @param Config $config
  * @param Router\RouteManager $router
  * @param Auth\Service $authService
  * @param Log\Manager $handler
  * @param ResponseManager $responseManager
  * @throws Log\Exception\LoggerNotRegistered
  */
 public function __construct(Config $config, Di\Container $di, Router\RouteManager $router, Auth\Service $authService, Log\Manager $handler, ResponseManager $responseManager)
 {
     $this->config = $config;
     $this->serviceLocator = $di;
     $this->router = $router;
     $this->authService = $authService;
     $this->errorLog = $handler->getLogger('error');
     $this->eventLog = $handler->getLogger('event');
     $this->responseManager = $responseManager;
     $this->authService->resume();
 }
Beispiel #3
0
 public function testResumeCallsResumeAndReturnsUser()
 {
     $this->resume->shouldReceive('resume')->with($this->service->getUser())->once();
     $user = $this->service->resume();
     $this->assertInstanceOf('Aura\\Auth\\Auth', $user);
 }