You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve encountered an issue with Laravel Socialite version 5.16.1 in production. When using Socialite::driver('google')->redirect() for social login, the application throws the following error:
Error: Target [Laravel\Socialite\Contracts\Factory] is not instantiable.
publicfunctionredirect(Request$request, string$driver): RedirectResponse
{
try {
return Socialite::driver($driver)->redirect();
} catch (\Exception$e) {
Log::error("Error during social login redirect for {$driver}: " . $e->getMessage());
returnredirect()->route('login')->with('error', 'Unable to connect to ' . ucfirst($driver) . '. Please try again.');
}
}
The error occurs despite having the correct configuration in config/services.php for Google. Reverting to Socialite version 5.15.0 resolves the issue, suggesting a regression in the latest version. This breaks social login functionality and disrupts user authentication.
This happens only on production because I didn't face any problems when using the latest version locally.
Steps taken:
Verified Laravel and Socialite versions.
Checked services.php configuration.
Identified the issue doesn’t exist in 5.15.0.
This appears to be a problem with dependency injection for Factory (not completely sure). Would appreciate assistance in resolving this.
Steps To Reproduce
Install Laravel Socialite v5.16.1 using composer require laravel/socialite.
Configure a social driver (e.g., Google) in config/services.php.
Attempt to redirect to the social login page in production using: return Socialite::driver('google')->redirect(); but it works locally just fine without issues.
Observe the error: "Target [Laravel\Socialite\Contracts.Factory] is not instantiable."
The text was updated successfully, but these errors were encountered:
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
We're closing this issue because it's inactive, already solved, old, or not relevant anymore. Feel free to open up a new issue if you're still experiencing this problem.
Socialite Version
5.16.1
Laravel Version
11.31
PHP Version
8.3
Database Driver & Version
MySQL
Description
I’ve encountered an issue with Laravel Socialite version
5.16.1
in production. When usingSocialite::driver('google')->redirect()
for social login, the application throws the following error:Error:
Target [Laravel\Socialite\Contracts\Factory] is not instantiable.
The error occurs despite having the correct configuration in
config/services.php
for Google. Reverting to Socialite version5.15.0
resolves the issue, suggesting a regression in the latest version. This breaks social login functionality and disrupts user authentication.This happens only on production because I didn't face any problems when using the latest version locally.
Steps taken:
services.php
configuration.5.15.0
.This appears to be a problem with dependency injection for
Factory
(not completely sure). Would appreciate assistance in resolving this.Steps To Reproduce
composer require laravel/socialite
.config/services.php
.return Socialite::driver('google')->redirect();
but it works locally just fine without issues.The text was updated successfully, but these errors were encountered: