diff --git a/app/Http/Controllers/CustomAuthController.php b/app/Http/Controllers/CustomAuthController.php index 2fc2994..0dc825c 100644 --- a/app/Http/Controllers/CustomAuthController.php +++ b/app/Http/Controllers/CustomAuthController.php @@ -19,6 +19,18 @@ class CustomAuthController extends Controller { $password = $post['password']; if (Auth::attempt(['email' => $email, 'password' => $password])){ + + if (Auth::user()->role == 'admin') { + $message = ' +
+ +

ERROR:

+ You are not allowed to enter to this site. +
'; + return response()->json(array('success' => false, 'message'=>$message)); + } + + $message = "success"; $navbar = view('layout.navbar', compact('view'))->render(); $save_design_button = ' ';