⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.177
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
ctaacademy
/
www
/
app
/
Http
/
Controllers
/
Auth
/
View File Name :
SocialiteController.php
value) { self::setFacebookLoginInfo(); } elseif ($driver == SocialiteDriverType::GOOGLE->value) { self::setGoogleLoginInfo(); } } public function redirectToDriver($driver) { if (in_array($driver, SocialiteDriverType::getAll())) { return Socialite::driver($driver)->redirect(); } $notification = __('Invalid Social Login Type!'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } public function handleDriverCallback($driver) { if (!in_array($driver, SocialiteDriverType::getAll())) { $notification = __('Invalid Social Login Type!'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } try { $provider_name = SocialiteDriverType::from($driver)->value; $callbackUser = Socialite::driver($provider_name)->stateless()->user(); $user = User::where('email', $callbackUser->getEmail())->first(); if ($user) { $findDriver = $user ->socialite() ->where(['provider_name' => $provider_name, 'provider_id' => $callbackUser->getId()]) ->first(); if ($findDriver) { if ($user->status == UserStatus::ACTIVE->value) { if ($user->is_banned == UserStatus::UNBANNED->value) { if (app()->isProduction() && $user->email_verified_at == null) { $notification = __('Please verify your email'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect() ->back() ->with($notification); } if ($findDriver) { Auth::guard('web')->login($user, true); $notification = __('Logged in successfully.'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect() ->intended(route('student.dashboard')) ->with($notification); } } else { $notification = __('Inactive account'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect() ->back() ->with($notification); } } else { $notification = __('Inactive account'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect() ->back() ->with($notification); } } else { $socialite = $this->createNewUser(callbackUser: $callbackUser, provider_name: $provider_name, user: $user); if ($socialite) { Auth::guard('web')->login($user, true); $notification = __('Logged in successfully.'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect() ->intended(route('user.dashboard')) ->with($notification); } $notification = __('Login Failed'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect() ->back() ->with($notification); } } else { if ($callbackUser) { $socialite = $this->createNewUser(callbackUser: $callbackUser, provider_name: $provider_name, user: false); if ($socialite) { $user = User::find($socialite->user_id); Auth::guard('web')->login($user, true); $notification = __('Logged in successfully.'); $notification = ['messege' => $notification, 'alert-type' => 'success']; return redirect() ->intended(route('student.dashboard')) ->with($notification); } $notification = __('Login Failed'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect() ->back() ->with($notification); } $notification = __('Login Failed'); $notification = ['messege' => $notification, 'alert-type' => 'error']; return redirect()->back()->with($notification); } } catch (\Exception $e) { return to_route('login'); } } }