Skip to content
Snippets Groups Projects
Commit ed6c0987 authored by iLazaKnight's avatar iLazaKnight
Browse files

Sprint-2 Kelar

parent 20235b66
Branches
Tags
No related merge requests found
Pipeline #7872 failed with stages
......@@ -42,7 +42,7 @@ class SocialAccountsController extends Controller
//dd(auth()->guard('member')->user());
try {
//$user = Socialite::with($provider)->user();
$user = Socialite::with($provider)->setHttpClient(new \GuzzleHttp\Client(['curl' => array(CURLOPT_PROXY => 'cache.itb.ac.id', CURLOPT_PROXYPORT => 8080, CURLOPT_PROXYUSERPWD => 'yowinarto:06561330', CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2)]))->user();
$user = Socialite::with($provider)->setHttpClient(new \GuzzleHttp\Client(['curl' => array(CURLOPT_PROXY => '', CURLOPT_PROXYPORT => '', CURLOPT_PROXYUSERPWD => '', CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2)]))->user();
//dd(Socialite::with($provider)->setHttpClient(new \GuzzleHttp\Client(['curl' => array(CURLOPT_PROXY => 'cache.itb.ac.id', CURLOPT_PROXYPORT => 8080, CURLOPT_PROXYUSERPWD => 'yowinarto:06561330', CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_2
//)]))->user());
} catch (Exception $e) {
......@@ -60,6 +60,7 @@ class SocialAccountsController extends Controller
auth()->guard('member')->user(),
$provider
);
//print_r($linkStatus);
}
if($linkStatus)
return redirect()->to('/members/'.auth()->guard('member')->user()->id)->with('success',ucfirst($provider).' account successfully linked');
......
......@@ -16,6 +16,9 @@ class EventServiceProvider extends ServiceProvider
'App\Events\Event' => [
'App\Listeners\EventListener',
],
SocialiteProviders\Manager\ServiceProvider::class => [
'SocialiteProviders\\LinkedIn\\LinkedInExtendSocialite@handle'
],
];
/**
......
......@@ -52,6 +52,21 @@ class SocialAccountService
break;
case 'linkedin':
$member->linkedin_email = $providerUser->getEmail();
$member->name = $providerUser->getName();
if(array_key_exists("pictureUrls",$providerUser->user)){
file_put_contents('../public/storage/profile_image/'.$member->id.'.jpg', file_get_contents($providerUser->user["pictureUrls"]["values"][0]));
$member->profile_image = $member->id.'.jpg';
}
if(array_key_exists("industry",$providerUser->user)){
$member->interest = $providerUser-> user["industry"];
}
if(array_key_exists("location",$providerUser->user)){
$member->address = $providerUser-> user["location"]["name"];
}
if(array_key_exists("positions",$providerUser->user)){
$member->company = $providerUser-> user["positions"]["company"]["name"];
}
//return print_r($providerUser);
break;
default:
break;
......
......@@ -160,7 +160,7 @@ return [
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Unisharp\Ckeditor\ServiceProvider::class,
SocialiteProviders\Manager\ServiceProvider::class
],
/*
......
public/storage/profile_image/1.jpg

54.7 KiB

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment