superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.61k stars 304 forks source link

[bug] Unable to login with emacs mastodon.el #1092

Closed dmacvicar closed 1 year ago

dmacvicar commented 1 year ago

Describe the bug with a clear and concise description of what the bug is.

When login in to gotosocial from mastodon.el, I get:

mastodon-auth--handle-token-response: Mastodon-auth--access-token: invalid_request: Bad Request: redirect_uri was not set in the token request form

As mastodon-client-register sets ("redirect_uris" . "urn:ietf:wg:oauth:2.0:oob"), I tried adding ("redirect_uri" . "urn:ietf:wg:oauth:2.0:oob") to mastodon-auth--generate-token-no-storing-credentials and mastodon-auth--generate-token-and-store but then the error changes to:

let: Mastodon-auth--access-token: invalid_request: Bad Request: could not validate token request: invalid_request

What's your GoToSocial Version?

0.5.2 git-c31f219

GoToSocial Arch

x86_64

Also tracked here: https://codeberg.org/martianh/mastodon.el/issues/312

dmacvicar commented 1 year ago

Update:

This was caused by an outdated recipe not supporting OAUTH2 with code (only password).

The outdated recipe seems to be a mix of:

After overriding manually:

(use-package mastodon
  :straight (:host nil :type git :repo "https://codeberg.org/martianh/mastodon.el.git")
...

I could make it work. Two improvements come to mind:

(full story on the mastodon.el bug)