janboddez / share-on-mastodon

Easily share WordPress posts on Mastodon.
https://jan.boddez.net/wordpress/share-on-mastodon
GNU General Public License v3.0
39 stars 5 forks source link

Authorize "code" not recognized? #106

Closed janboddez closed 2 months ago

janboddez commented 2 months ago

So, I somehow had my token deleted. But when I clicked "Authorize Access," nothing happened. Even though I was probably) being redirected and ended up getting a code URL param.

Deleting all settings first worked.

So I guess my instance didn't require me to explicitly authorize WP and its scopes, maybe because everything was still valid on their end.

We probably should process the code and fetch a token ...

janboddez commented 2 months ago

Tried to reproduce by going into my Mastodon account's settings, revoking the token, and running the WP cron job that verifies its validity. Token got deleted okay, the "Authorize" button showed when I next visited the settings screen, and I was able to fetch a new token (and authorize WordPress) just fine.

Right, so all works as intended.

What could've happened is, like, maybe the instance was down when we tried to verify our previously obtained token, and we deleted it as a result. And then when trying to reauthorize WP, Mastodon just gave us a code, no need to reconfirm any scopes. Like, maybe ...

Except we should just use that to get a new token ... Unfortunately, can't reproduce right now.