JSn1nj4 / ElliotDerhay.com

My personal website project.
MIT License
0 stars 1 forks source link

Fix token "expires_at" issue #47

Closed JSn1nj4 closed 2 years ago

JSn1nj4 commented 2 years ago

This issue was discovered via the App\Services\Twitter\TwitterService class.

Overview

When checking for a valid Twitter token using Model::valid(), one of the conditions is whether the model's "expires_at" field is null. Since the bearer token returned by Twitter's API doesn't have an expiration date normally, this field is always set to null in the DB.

The result is that TwitterService is always retrieving a new copy of the API token.

This was temporarily fixed in 6363ef6 on TwitterService:64 by commenting out the call to valid(). For now, the latest token will always be used.

JSn1nj4 commented 2 years ago

Somehow still didn't get closed, so closing manually.