chrisreedio / socialment

Socialite OAuth Support for Filament
MIT License
73 stars 10 forks source link

[Bug]: $createUserClosure must not be accessed before initialization #62

Open Cybrarist opened 5 days ago

Cybrarist commented 5 days ago

What happened?

the application goes to google and redirects back, then the following errors shows

Typed property ChrisReedIO\Socialment\SocialmentPlugin::$createUserClosure must not be accessed before initialization

How to reproduce the bug

require the plugin. composer require chrisreedio/socialment

install the plugin php artisan socialment:install

require the provider composer require socialiteproviders/google

add the event listener, and the plugin to the admin panel

 protected $listen = [     
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
        \SocialiteProviders\Manager\SocialiteWasCalled::class => [
            // ... other providers
            \SocialiteProviders\Google\GoogleExtendSocialite::class."@handle",
        ],];

update tailwind configs "./vendor/chrisreedio/socialment/resources/**/*.blade.php",

add the pluging to the panel

\ChrisReedIO\Socialment\SocialmentPlugin::make()->registerProvider(
     'google' , 'fab-google','Google' ),

trying to login

Package Version

v3.9.0

PHP Version

8.2

Laravel Version

10.45.1 and 10.47.0

Which operating systems does with happen with?

macOS, Linux

Notes

suggested fix in file vendor/chrisreedio/socialment/src/SocialmentPlugin.php:33

update it to the following:

public ?Closure $createUserClosure=null;
altomar commented 4 days ago

The fix also worked for me 🙏

looksystems commented 4 hours ago

Same problem here - the fix works for me too.