简体   繁体   English

Twitter Omniauth个人资料图片在Twitter上发生变化后破碎

[英]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. 我有twitter ommiauth作为我的用户模型,当他们通过hash auth.info.image注册他们的个人资料图片的链接时我拉。 Iv noticed some are now breaking where the user has updated their profile picture on Twitter. Iv注意到有些人正在打破用户在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. 我注意到有一部分哈希在raw_info部分中通过https(profile_image_url_https)获取图像。 Details here https://github.com/arunagw/omniauth-twitter . 详情请访问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. 如果您在用户创建帐户或通过oAuth登录时保存Twitter图像URL,而不是在尝试显示它时检查它是否已更改,则可以预期。 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. 我唯一能想到修复消失的链接的方法是使用http或url调用来测试数据,并用占位符图像替换它或ping API以检索更新的图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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