mardi 29 décembre 2015

Laravel Socialite HTTPS twitter avatar

I am using laravel 5.0 and utlising the socialite extension to enable twitter login. I encountered a problem with the retrieval of the users twitter profile picture.

The url for the profile picture I receive from twitter is in the following format.

http://ift.tt/1M2NaIZ

This is saved to my db and shown when the user logs into their account. The problem is this image is serving over HTTP and is producing browser warnings when users are accessing their account, as not all the page content is served over HTTPS.

Is there any way to save the twitter profile picture with HTTPS compared to HTTP.

 $user = User::create([
            'provider_id' => $userData->id,
            'name' => $userData->name,
            'username' => $userData->nickname,
            'email' => $userData->email,
            'avatar' => $userData->avatar,
            'active' => 1,
        ]);

I save the user twitter data to my db as shown above and it the $userData->avatar part which is saving the HTTP url.

I can't seem to work a way around this and can't find much documentation on the issue. Any help would be appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire