Laravel5 - 社交网络聚会,如何返回用户()?

时间:2015-11-18 05:12:57

标签: laravel laravel-5.1 laravel-socialite meetup

我收到以下错误:

Whoops, looks like something went wrong.
1/1
ErrorException in Arr.php line 238:
explode() expects parameter 2 to be string, array given
in Arr.php line 238
at HandleExceptions->handleError('2', 'explode() expects parameter 2 to be string, array given', '/home/vagrant/api/vendor/laravel/framework/src/Illuminate/Support/Arr.php', '238', array('array' => 'photo.photo_link', 'key' => array('birthday' => array('etc...

重定向很好但是在返回时问题就开始了。

根据socialite meetup documentation我遵循laravel处理授权的方式但是,如果没有转储用户详细信息,我做错了什么?

我的代码:

<?php

namespace App\Http\Controllers\Auth;

use Socialite;
use Illuminate\Routing\Controller;

class AuthMeetupController extends Controller
{
    /**
     * Redirect the user to the meetup authentication page.
     *
     * @return Response
     */
    public function redirectToProvider()
    {

        if(\Input::has('code')){
            dd($this->handleProviderCallback());
        }
        return Socialite::driver('meetup')->redirect();


    }

    /**
     * Obtain the user information from meetup.
     *
     * @return Response
     */
    public function handleProviderCallback()
    {

        $user = Socialite::driver('meetup')->user();

        dump($user);

        // $user->token;
    }
}

0 个答案:

没有答案