I’m using devise and omniauth-facebook for authentication in my app. The sign up form has all the usual fields – name, email, password, as well as some custom fields (gender, age, and some nested attributes as check boxes).
How can I save the data from the custom fields and use it when I create my user (in my omniauth callback action)? Would it make more sense to only use omniauth and scrap devise..? with omniauth identity perhaps?
Rails newbie here – sorry if the questions are silly.. and thanks for taking the time to read this, really appreciate the help!
I had a similar problem and I solved it using OAuth state parameter. You can pass these parameters along the request to facebook in the ‘state’ parameter. Once you get the control back you can get the data back from this parameter.
See my original question and answer here.
BTW, If you’re connecting to the user’s Facebook, you may also query Facebook for the information instead of asking for it in a form. Just be careful not to violate Facebook’s TOS with the data.