ueberauth / ueberauth_twitter

Twitter Strategy for Überauth
MIT License
36 stars 38 forks source link

More descriptive error message on OAuth request_token failure #31

Closed arnodirlam closed 5 years ago

arnodirlam commented 5 years ago

Hi!

I've had problems with the app configuration on Twitter, and did not see proper error messages when using the OAuth modules. So I created an improved error message that formats the OAuth response as more readable exception message that is, in turn, rendered by Phoenix (or whatever you use).

Let me know whether this seems good & useful.

Hanspagh commented 5 years ago

Hi. Thanks for the pull request. I was thinking it might make sense to decode the body as json to avoid the regex, I think this would make it easier to maintain in the long run. This might be something of a bigger change, so perhaps it belongs in its own pr? @ueberauth/developers

doomspork commented 5 years ago

@Hanspagh I think that's a great suggestion, the RegEx seems a little unnecessary

arnodirlam commented 5 years ago

done. It requests JSON responses in general now, and decodes them if applicable. So response handling can now deal with the decoded response data.

doomspork commented 5 years ago

@Hanspagh any final thoughts?

Hanspagh commented 5 years ago

Great work. looks much cleaner now :D

arnodirlam commented 5 years ago

Thanks a lot for the feedback and merging my PR! 🎉

I've got 3 more PRs up my sleeve that I'll submit by this weekend 😉