简体   繁体   中英

Twitter Omniauth Profile Picture Broken after changed on Twitter

I have twitter ommiauth as my user model and I pull in when they register a link of their profile picture via the hash auth.info.image. Iv noticed some are now breaking where the user has updated their profile picture on Twitter.

I noticed there is a part of the hash that gets the image over https (profile_image_url_https) in the raw_info section. Details here https://github.com/arunagw/omniauth-twitter . is this the best practice to link to so it doesnt happen again?

My issue is that I may have a user that logs in once and leaves a comment but then their profile changes and it breaks on the site.

Is there another way I should be implementing this?

Any information would be much appreciated.

If you are saving the twitter image url when a user creates an account or logs in via oAuth and not checking whether it has changed when attempting to display it this would be expected. The only thing I can think of to fix disappearing links would be to test the data with an http or url call and replace it with a placeholder image or ping the API to retrieve the updated image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM