Laravel Socialite Twitter (Oauth1)
I am having trouble with twitter login via laravel socialite.
Socialite::driver('twitter')->user();
the code above throws an error with message:
Argument 1 passed to League\OAuth1\Client\Server\Server::getTokenCredentials() must be an instance of League\OAuth1\Client\Credentials\TemporaryCredentials, null given
I checked Laravel Socialite documentation and it says that to get the user details of a twitter account, I should use
Socialite::driver('twitter')->userFromTokenAndSecret($token, $tokenSecret);
instead of
Socialite::driver('twitter')->user();
But it isn't explained how to get the $token and $tokenSecret parameter. I hard coded the $token and $tokenSecret using the keys in the twitter application but everytime I log in other account it still uses that account which I understand since the code is hard coded. Is there anyway to get the user's $token and $tokenSecret when they log in? Thank you