change
This commit is contained in:
@@ -39,7 +39,9 @@ class LoginController extends Controller
|
||||
'password' => 'required|string',
|
||||
]);
|
||||
|
||||
$user = IamPrincipal::where('email_address', $validatedData['email'])->first();
|
||||
$user = IamPrincipal::where('email_address', $validatedData['email'])
|
||||
->whereIn('principal_type_xid', [1, 2])
|
||||
->first();
|
||||
|
||||
if ($user) {
|
||||
if (Hash::check($validatedData['password'], $user->password)) {
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class CheckStatus
|
||||
@@ -17,7 +18,8 @@ class CheckStatus
|
||||
{
|
||||
|
||||
$admin = auth()->guard('admin')->user();
|
||||
if ($admin && $admin->is_active == 1) {
|
||||
Log::info($admin);
|
||||
if ($admin && $admin->is_active == 1 && ($admin->principal_type_xid == 1 || $admin->principal_type_xid == 2)) {
|
||||
return $next($request);
|
||||
} else {
|
||||
return redirect('/')->with('error_msg', 'You must be logged in..');
|
||||
|
||||
Reference in New Issue
Block a user