使用omniauth gem,我不得不为成功登录定义一个单路由回调,而不管提供程序是什么:
def auth_callback
auth_data = request.env['omniauth.auth']
if auth_data.has_key('something')
process_one(auth_data)
else
process_two(auth_data)
end
# No view is available here
end
def process_one
# do something then render view for process_one
return
end
def process_two
# do something then render view for process_two
return
end
如何防止控制器返回到auth_回调方法并try 显示相应的视图(该视图不存在)?一旦过程1或过程2方法返回,治疗应视为完成.