From 9a2160c325a8ed35b499f34ded535c3a0bdf74a5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 1 Mar 2021 13:51:00 +1100 Subject: [PATCH] Verified users only for hosted platform --- app/Http/Middleware/UserVerified.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Middleware/UserVerified.php b/app/Http/Middleware/UserVerified.php index ce8a899764..06b45d9c49 100644 --- a/app/Http/Middleware/UserVerified.php +++ b/app/Http/Middleware/UserVerified.php @@ -13,6 +13,7 @@ namespace App\Http\Middleware; use App\Libraries\MultiDB; use App\Models\User; +use App\Utils\Ninja; use Closure; use Hashids\Hashids; use Illuminate\Http\Request; @@ -38,16 +39,14 @@ class UserVerified */ public function handle($request, Closure $next) { + if(Ninja::isSelfHost()) + return $next($request); $error = [ 'message' => 'Email confirmation required.', 'errors' => new \stdClass, ]; - // nlog(auth()->user()->toArray()); - // nlog($this->user->toArray()); - // nlog((bool)$this->user->isVerified()); - if ($this->user && !$this->user->isVerified()) return response()->json($error, 403);