首先让你的编辑/app/anvar/config/routes.php
看起来像这样:
<?php
return array(
'index' => 'login',
'login' => 'login/{provider}',
'endpoint' => 'after/facebook',
/* note that endpoint can not be the same pattern as login
for example if I made it login/after it would go back to the login page with 'after' as $provider
*/
);
在其中创建一个文件app/storage/logs/
并将其命名为 hausth_debug_file.txt 然后将以下内容添加到您的/config/packages/anvard/hybridauth.php
"debug_mode" => true,
"debug_file" =>"D:\www\Dev\bp4\app\storage\logs\hauth_debug_file.txt",
//change this path with yours
这将在文件中转储很多用于调试的好信息,然后您可以共享文件以帮助解决问题。所以你的文件看起来像这样:
<?php
return array(
// 'base_url' => URL::route(Config::get('anvard::routes.login')),
'providers' => array (
'Facebook' => array (
'enabled' => true,
'keys' => array ( 'id' => 'yourr-key', 'secret' => 'your-secret' ),
//'scope' => Input::get('permission_scope','email, user_about_me, user_birthday, user_hometown, user_likes, user_interests, user_location'),
),
'Twitter' => array (
'enabled' => false,
'keys' => array ( 'key' => '', 'secret' => '' )
),
'LinkedIn' => array (
'enabled' => false,
'keys' => array ( 'key' => '', 'secret' => '' )
),
),
"debug_mode" => true,
"debug_file" =>"D:\www\Dev\bp4\hauth_debug_file.txt",
);
或者,您可以通过 /app/start/local.php 中的 config::set 设置此配置,也可以在 /anvard/src/Atticmedia/Anvard/routes.php 中设置此配置,我认为如果您更改return Redirect::back();
为return Redirect::to(Config::get('anvard::routes.endpoint'));
我还必须在第 230 行附近编辑 Atticmedia/Anvard/Anvard.php 以
$profile = new $ProfileModel();
foreach ($attributes as $key => $v) {
$profile->$key = $v;
}
$profile = $this->applyAdapterProfileToExistingProfile($adapter_profile, $profile);