All threads / Save facebook profile image in GCS

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Save facebook profile image in GCS

Shashindran VIjayan asked in Gems / Libraries
Hi, I'm trying to implement a simple social login feature where users can log in using facebook account. Currently I'm using devise omniauth for authentication and carrierwave and fog-google for image upload to Google Cloud Storage. Whenever I try to save the image to GCS, I'm getting 'string contains null byte' errors. How to resolve this?

user.rb
def self.from_omniauth(auth)
  create do |user|
    user.email = auth.info.email
    user.password = Devise.friendly_token[0, 20]
    user.first_name = auth.info.first_name
    user.last_name = auth.info.last_name
    user.username = auth.info.name
    user.remote_avatar_url = auth.info.image
    user.skip_confirmation!
  end
end


Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 34,674+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.