Ankit Suri
Ankit Suri

Reputation: 17860

omniauth.auth data outside session_controller

Basically I used the omniauth gem on my ruby on rails website to authenticate the user. The authData field of parse.com Database stores the details of user. That works fine.

I have been told to store the user's Facebook id in a different field for easy access to it. What I've been stuck on is: 1) I cannot seem to store the information from omniauth.auth to database in session_controller 2) I can store stuff on database from my user_controller, but there the auth = request.env["omniauth.auth"] does not seem to work.

Is the scope of auth content only in session controller?

Appreciate the help. Thank You.

Upvotes: 0

Views: 279

Answers (2)

Kashiftufail
Kashiftufail

Reputation: 10885

Rather than use this application and chill in which handle the same issue

  https://github.com/kashiftufail/facebook_login_using_devise_and_omniauth_facebook

Upvotes: 0

davidrac
davidrac

Reputation: 10738

The auth hash is available only in the controller that gets the callback. If you want to pass it onto another, you have to store it in the session or use some other way to pass it. You can check out this omniauth railscast, where this exact issue is handled.

Upvotes: 0

Related Questions