Currently we are calling the Twitter API on each settings page load unnecessarily. I've removed the calls to the api and consolidated it to a new endpoint on the UserSocialController -- "/users/social/twitter/connect".
The new endpoint will do the Twitter authorization_url lookup and, if successful, do the redirect to Twitter that the "Connect with Twitter" button on the user profile page would have done. If we are not successful in contacting the Twitter API, the endpoint will redirect the user back to the user profile page with an error message:
NOTE: I am awaiting access from Twitter to their API, so I am only able to test the error path and not the successful path at this time.
There should be no other changes to the Twitter auth flow as a result of this change.
fixes #634
Currently we are calling the Twitter API on each settings page load unnecessarily. I've removed the calls to the api and consolidated it to a new endpoint on the UserSocialController -- "/users/social/twitter/connect".
The new endpoint will do the Twitter authorization_url lookup and, if successful, do the redirect to Twitter that the "Connect with Twitter" button on the user profile page would have done. If we are not successful in contacting the Twitter API, the endpoint will redirect the user back to the user profile page with an error message:
NOTE: I am awaiting access from Twitter to their API, so I am only able to test the error path and not the successful path at this time.
There should be no other changes to the Twitter auth flow as a result of this change.