mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Verified users only for hosted platform
This commit is contained in:
parent
d238d53b26
commit
9a2160c325
@ -13,6 +13,7 @@ namespace App\Http\Middleware;
|
|||||||
|
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Hashids\Hashids;
|
use Hashids\Hashids;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@ -38,16 +39,14 @@ class UserVerified
|
|||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
|
if(Ninja::isSelfHost())
|
||||||
|
return $next($request);
|
||||||
|
|
||||||
$error = [
|
$error = [
|
||||||
'message' => 'Email confirmation required.',
|
'message' => 'Email confirmation required.',
|
||||||
'errors' => new \stdClass,
|
'errors' => new \stdClass,
|
||||||
];
|
];
|
||||||
|
|
||||||
// nlog(auth()->user()->toArray());
|
|
||||||
// nlog($this->user->toArray());
|
|
||||||
// nlog((bool)$this->user->isVerified());
|
|
||||||
|
|
||||||
if ($this->user && !$this->user->isVerified())
|
if ($this->user && !$this->user->isVerified())
|
||||||
return response()->json($error, 403);
|
return response()->json($error, 403);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user