Reputation: 4371
in the callback of the authentication process I do:
auth_hash = request.env['omniauth.auth']
and then, I'm extracting the user id, but is it possible in the same time getting the user's name and email address?
Upvotes: 1
Views: 1819
Reputation: 1071
yesss
u can get it by doing
auth_hash[:info][:name] for name and auth_hash[:info][:email] for email
Upvotes: 1
Reputation: 1174
You need to first get the raw data from request.env["omniauth.auth"]
data = request.env["omniauth.auth"].extra.raw_info
username = data.first_name
email = data.email
Upvotes: 8