Beispiel #1
0
 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->alexaRequest->isAlexaRequest()) {
         return $this->sendRequestThroughRouter($request);
     }
     return $next($request);
 }
Beispiel #2
0
 /**
  * @throws InvalidRequestTimestamp
  */
 private function checkTimestampTolerance()
 {
     //If the timestamp tolerance is set to 0 we'll skip the check (see config)
     if (array_get($this->config, 'timestampTolerance') === 0) {
         return;
     }
     $timestampTolerance = array_get($this->config, 'timestampTolerance');
     $timestamp = $this->alexaRequest->getTimestamp();
     if (time() - $timestamp > $timestampTolerance) {
         throw new InvalidRequestTimestamp("The request timestamp is older then configured timestamp tolerances allow");
     }
 }
Beispiel #3
0
 private function setupSession()
 {
     $this->session = $this->alexaRequest->getSession();
 }