Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SocialController@getLogin -- Provider is always null #7

Open
nicholeous opened this issue Dec 30, 2014 · 1 comment
Open

SocialController@getLogin -- Provider is always null #7

nicholeous opened this issue Dec 30, 2014 · 1 comment

Comments

@nicholeous
Copy link

Everything works perfectly except the provider parameter inside of SocialController@getLogin. For now I've forced it to always be facebook instead of accepting a parameter but I would really like it to be extensible to other providers without having to change too much.

My changes:

/**
 * Social providers controller.
 *
 * @author Mark Manos
 */
class SocialController extends Controller
{
    /**
     * Login action.
     *
     * @param string $provider
     *
     * @return mixed
     */
    public function getLogin($provider = null)
    {
/* This is the part that always fails. Provider is always null.
        if (empty($provider)) {
            App::abort(404);
        }
*/
        $provider = 'facebook';

I followed the readme instructions by passing in array('facebook'), array('provider'=>'facebook') and no parameters and nothing seems to work. I've tried both with and without the onsuccess and onerror params as well.

<a href="{{ route('social-login', array('provider'=>'facebook')) }}?onsuccess=/blog&onerror=/login">
    Log in with FaceBook
</a>

Currently using Laravel 4.2 on homestead.

Any ideas? Did I set something up incorrectly?

@fobus42
Copy link

fobus42 commented Jan 14, 2015

You can check my answer here: #13 (comment)

I had the same problem, and fixed by using this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants