1

I'm using the ThuJohn Twitter package for Laravel and am trying to post tweets as a site user, but keep getting [89] Invalid or expired token. errors.

I know the package is installed correctly because I can send tweets using the website's app credentials; it's when I'm trying to tweet as a site user I run into problems.

I'm using the reconfig method, yet am still encountering issues. I'm wondering if my user credentials are wrong?

Here's the reconfig method:

Twitter::reconfig([
    'consumer_key' => env('TWITTER_CONSUMER_KEY'),
    'consumer_secret' => env('TWITTER_CONSUMER_SECRET'),
    'token' => $user->twitter->token,
    'secret' => $user->twitter->secret
]);

And this is how I'm grabbing the user's token and secret inside the callback method. Is this the correct way?

$request_token = [
    'token'  => Session::get('oauth_request_token'),
    'secret' => Session::get('oauth_request_token_secret'),
];
timgavin
  • 4,972
  • 4
  • 36
  • 48
  • If you're using the config cache, this answer might solve the problem: https://stackoverflow.com/questions/40026893/what-is-difference-between-use-envapp-env-configapp-env-or-appenviron – Mathew Tinsley Dec 03 '17 at 20:24
  • @mtinsley Thank you, however that's not the issue as I've been trying it with hardcoded values as well. – timgavin Dec 03 '17 at 22:00

0 Answers0