首先编辑您的/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);