starterkits/rails4-starterkit

How to use additional FB permissions

Closed this issue · 2 comments

The social Login with this starter app works great. Many thanks.

I want to request a little more info about my users which requires two things:

  1. I need to add a couple items to the FB request
  2. I need to load the provided data into the db.

From my looking at the code it looks like this is handled in models/concerns/omniauth_concern.rb. Any direction you can provide would be super helpful as I am new to this stuff.

Hi @Ravenna. You can easily request more info in the config/auth.yml. And then modify omniauth_concern.rb to save it. This works well if you're only using Facebook for auth.

If you're supporting lots of auth providers, then the best practice (for personal experience) is to add an after save hook in the Auth model to trigger a background job to fetch additional data per provider.

thanks for the notes.