devise-twitter icon indicating copy to clipboard operation
devise-twitter copied to clipboard

Store Twitter ID as unique identifier

Open krzkrzkrz opened this issue 14 years ago • 6 comments

Wouldnt it be wise to store the twitter id and have that as the primary field instead of the twitter_handle? If a user decides to change his twitter name in twitter.com, then this gem will create a another user record on the db.

Second, how does the app keep track of users who change their twitter handle? At least with the twitter id, this will always be unique never changing...

krzkrzkrz avatar Sep 29 '10 15:09 krzkrzkrz

You are completely right, I did not think of that.

MSch avatar Sep 29 '10 15:09 MSch

Glad to hear. Keep me updated

krzkrzkrz avatar Sep 29 '10 15:09 krzkrzkrz

Hi MSch, any updates on this?

krzkrzkrz avatar Oct 01 '10 20:10 krzkrzkrz

I've got a partial fix for this submitted as a pull request: http://github.com/MSch/devise-twitter/pull/14

By reading this issue, I get that a couple more changes are needed so that users are looked up by their twitter_id and not twitter_handle.

I will work on that.

amuino avatar Oct 07 '10 10:10 amuino

Should be ready now.

The twitter_handle is updated (if needed) on connect or signup.

amuino avatar Oct 07 '10 12:10 amuino

just to clarify, by contacting the twit api with a oauth token and secret and calling verify_credentials will return a user's twitter handle even if the correct one is not in the database. Oauth really is all about creating a secure environment to exchange information over an unsecure network, that was the original purpose anyways.

mastermike14 avatar May 10 '11 08:05 mastermike14