小编Don*_*aJo的帖子

Laravel 5和Socialite-登录后新重定向

这里还有另一个新问题,但希望有人能阐明一些观点:

我将Laravel 5与Socialite结合使用,我希望能够在用户登录后将其重定向到网站上的页面。问题是使用

return redirect('any-path-I-put-here');
Run Code Online (Sandbox Code Playgroud)

只需将其重定向回“ social-site / login?code = afkjadfkjdslkfjdlkfj ...”(其中“ social-site”是指正在使用的任何网站,例如,facebook,twitter,google等)。

因此,在我看来正在发生的事情是,Socialite / Contracts / Provider接口中的redirect()函数覆盖了我事后尝试执行的任何重定向。

为了澄清起见,我的路线设置正确。我已经尝试了可以​​想象到的每个版本的“重定向”(“到”,“后退”,“预期”,重定向::等),并且正在从我的Auth Controller调用该方法(尽管我已经在其他地方尝试过了)以及)。

问题是,使用社交名流存储和登录用户后,如何覆盖该redirect()?任何帮助表示赞赏!先感谢您。

包含相关重定向的代码为:

public function socialRedirect( $route, $status, $greeting, $user )
{

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

    if( $status == 'new_user' ) {
        // This is a new member. Make sure they see the welcome modal on redirect
        \Session::flash( 'new_registration', true );

        return redirect()->to( $route );// This is just the most recent attempt. It originated with return redirect($route);, and has been attempted …
Run Code Online (Sandbox Code Playgroud)

redirect laravel laravel-5 laravel-socialite

5
推荐指数
1
解决办法
6179
查看次数

标签 统计

laravel ×1

laravel-5 ×1

laravel-socialite ×1

redirect ×1