Ruby on rails 3 Rails Doorkeeper-重定向到主页而不是授权页面

Ruby on rails 3 Rails Doorkeeper-重定向到主页而不是授权页面,ruby-on-rails-3,oauth,Ruby On Rails 3,Oauth,当我尝试在rails应用程序中使用door_keeper gem时,我遇到了一个奇怪的问题。当我使用Oauth2 gem获取令牌时,就会出现问题。但在我的url部分: http://0.0.0.0:3000/oauth/authorize?response_type=code&client_id=199f27a02764f1ef1d31c2860b83ef93c0cc3dc26886d2b3d76b8ef1e935f3ae&redirect_uri=http%3A%2F%2F0.0.0.0%3A

当我尝试在rails应用程序中使用door_keeper gem时,我遇到了一个奇怪的问题。当我使用Oauth2 gem获取令牌时,就会出现问题。但在我的url部分:

http://0.0.0.0:3000/oauth/authorize?response_type=code&client_id=199f27a02764f1ef1d31c2860b83ef93c0cc3dc26886d2b3d76b8ef1e935f3ae&redirect_uri=http%3A%2F%2F0.0.0.0%3A3000%2Fcallback

它不会重定向到我们授权并获取令牌的页面,但会直接重定向到
http://0.0.0.0:3000


我这里有什么问题,它应该首先重定向到应用程序授权页面,不是吗?

授权页面需要一些用户登录。您在
资源\u所有者\u验证器
块中设置了它,它应该如下所示:

resource_owner_authenticator do |routes|
  # Put your resource owner authentication logic here.
  # If you want to use named routes from your app you need
  # to call them on routes object eg.
  # routes.new_user_session_path
  User.find(session[:user_id]) || routes.new_user_session_path
end
在这种情况下,如果用户在尝试访问
/oauth/authorize
时不在会话中,它将被重定向回
新用户会话路径


只有在会话中找到用户时,您才能看到授权页面。

我得到一个
未定义的局部变量或方法“routes”,用于
error.resource_owner_authenticator do | routes|