diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index 5687421..89b5a12 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -28,6 +28,9 @@ public function login() public function loginCallback() { $user = Socialite::driver('identity')->user(); + if (!in_array('54ZYODX15G2K1M76', $user->user['groups'], true)) { + return redirect()->route('auth.login')->with('error', 'You are not allowed to access this application'); + } $user = User::updateOrCreate([ 'remote_id' => $user->getId(), ], [