gpt4 book ai didi

laravel-5 - Laravel 5.5 社交名流集成显示错误 formatRedirectUrl() 必须是数组类型,给定 null

转载 作者:行者123 更新时间:2023-12-03 02:15:16 27 4
gpt4 key购买 nike

我正在使用“laravel/socialite”:“^3.0”来登录Facebook。但它表明一个错误

Type error: Argument 1 passed to Laravel\Socialite\SocialiteManager::formatRedirectUrl() must be of the type array, null given, called in /var/www/html/mas/vendor/laravel/socialite/src/SocialiteManager.php.

当我在登录 Controller 中调用以下函数时会发生这种情况

public function socialLogin($social)
{
return Socialite::driver($social)->redirect();
}

最佳答案

您好,您缺少提供社交媒体的凭据,请将其放入 config/services.php

'facebook' => [
'client_id' => env('FACEBOOK_CLIENT_ID'),
'client_secret' => env('FACEBOOK_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_FACEBOOK'),
],
'google' => [
'client_id' => env('GOOGLE_CLIENT_ID'),
'client_secret' => env('GOOGLE_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_GOOGLE'),
],
'twitter' => [
'client_id' => env('TWITTER_CLIENT_ID'),
'client_secret' => env('TWITTER_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_TWITTER'),
],
'linkedin' => [
'client_id' => env('LINKEDIN_CLIENT_ID'),
'client_secret' => env('LINKEDIN_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_LINKEDIN'),
],
'instagram' => [
'client_id' => env('INSTAGRAM_CLIENT_ID'),
'client_secret' => env('INSTAGRAM_CLIENT_SECRET'),
'redirect' => env('CALLBACK_URL_INSTAGRAM'),
],

关于laravel-5 - Laravel 5.5 社交名流集成显示错误 formatRedirectUrl() 必须是数组类型,给定 null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47365532/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com