User.find_for_oauth - where can I find it?

☆樱花仙子☆ 提交于 2019-12-11 08:09:18

问题


I'm studying Devise + omniauth. In most examples I find method User.find_for_oauth

Where can I find docs for this method & its ins and outs? Is it provided by Devise or omniauth gems?

here and here are some examples where I came across it.


回答1:


The User.find_for_oauth() isn't provided by Devise or Omniauth. It's something you have to provide.

Have another look at the examples in the links you gave. They show code for find_for_auth. The first link has it in the app/models/user.rb code in the Basic Implementation section. The second has it in an ActiveRecordHelpers class which they include in their User model.



来源:https://stackoverflow.com/questions/25598220/user-find-for-oauth-where-can-i-find-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!