我正在使用“omniauth-google-oauth2”登录谷歌并仔细按照此处的所有说明进行操作
https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview
但我上面有错误。
我的路线
devise_for :users, :controllers => {
:omniauth_callbacks => "users/omniauth_callbacks"
}
设计.rb代码
config.omniauth :google_oauth2, "863625299460- 420n6c7lvad91dfvko60uamtvtr6huhf.apps.googleusercontent.com", "dcvA2aZRZi27KCQjWTYP30pw", { access_type: "offline", approval_prompt: "" }
omniauth 回调控制器代码
def google_oauth2
#@user = User.find_for_google_oauth2(request.env["omniauth.auth"], current_user)
binding.pry #control not coming here
end
回调后我在下面有错误。看截图
https://github.com/zquestz/omniauth-google-oauth2/issues/52