New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel 5.3 Laravel\Passport\Client uses the wrong database connection when requesting a token #76
Comments
I also have some issues
btw @taylorotwell
|
After further investigation I found this issue is directly related to DotEnv. I added some code in the Builder class and could see that the database configuration being used was from the CLIENT and not the SERVER configuration. I ran artisan config:cache and the problem went away! Morale of the story is don not rely on DotEnv even in development environment! |
This is gold! I spent six hours trying to solve this issue. Thank you. |
issue still persists in version 7 as of mid 2019 and your solution still works |
@MarkLL u r my lifesaver! been working for this for 2 days and yet cant figure out the problem myself. thanks for your solution |
|
I have same issue, and i run Note : i use laravel 8 |
So I followed Taylors introduction to Passport on Laracasts and when I attempted to POST to the OAuth server
/oauth/token
URL with the newly acquired code I get a 'homestead.oauth_clients' doesn't exist' error.In other words it's using the wrong database connection! I set this up using SQLite and even hard coded
'default' => 'sqlite'
in config/database.php. (.env is also set correctly)In the end I had to add
protected $connection = 'sqlite';
to the Laravel\Passport\Client.php file to get it to work. Obviously this is not really a suitable fix. Just wondering where I might look to see where it determines the connection to use.Here is the complete errorlog for reference:
The text was updated successfully, but these errors were encountered: