Example #1
0
 public function handle($request, Closure $next)
 {
     $accountable = true;
     if ($request->header('X-TOR', false) || is_hidden_service()) {
         // Consider a user unaccountable if there's a custom X-TOR header,
         // or if the hostname is our hidden service name.
         $accountable = false;
     } elseif (!env('APP_DEBUG', false) && env('APP_URL_HS', false) && (new Geolocation())->getCountryCode() == "tor") {
         throw new TorClearnet();
     }
     $this->auth->user()->setAccountable($accountable);
     return $next($request);
 }
Example #2
0
 public function handle($request, Closure $next)
 {
     $accountable = !$request->header('X-TOR', false);
     $this->auth->user()->setAccountable($accountable);
     return $next($request);
 }