Christian Giupponi
Christian Giupponi

Reputation: 7618

Laravel 5 - redirect not working

I'm not able to redirect in my application using:

return redirect('/);

The problem comes from when the user do a login using facebook.
Facebook returns a url that contains #= and seems to block my site execution:

public function createUserFromFacebookInfos( $info )
    {
        $user = User::firstOrCreate([
            'email' => $info->email
        ]);

        $user->name = $info->name;
        $user->provider_token = $info->token;
        $user->provider_id = 1;
        $user->save();

        $this->auth->login( $user );

        return redirect('/');
    }

How can I remove that piece of url?
I have read that that code is added when redirect_uri is missing, but where should I set this redirect_uri?

Upvotes: 2

Views: 1182

Answers (1)

Margus Pala
Margus Pala

Reputation: 8673

Make sure that you are propagating the redirect object returned from sub-function out from your main controller function.

Upvotes: 3

Related Questions