Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在身份验证过程的回调中,我执行以下操作: auth_hash = request.env['omniauth.auth']
auth_hash = request.env['omniauth.auth']
然后,我正在提取用户 ID,但是否可以同时获取用户的姓名和电子邮件地址?
您需要首先从 request.env["omniauth.auth"] 获取原始数据
data = request.env["omniauth.auth"].extra.raw_info username = data.first_name email = data.email
是的
你可以通过做得到它
auth_hash[:info][:name] for name and auth_hash[:info][:email] for email