{"action":"created","issue":{"url":"https://api.github.com/repos/plataformatec/devise/issues/3643","labels_url":"https://api.github.com/repos/plataformatec/devise/issues/3643/labels{/name}","comments_url":"https://api.github.com/repos/plataformatec/devise/issues/3643/comments","events_url":"https://api.github.com/repos/plataformatec/devise/issues/3643/events","html_url":"https://github.com/plataformatec/devise/issues/3643","id":89876055,"number":3643,"title":"Redirect loop when using `authenticate` in routes.rb (plus pull request that caused it)","user":{"login":"stevenmilton58","id":12016412,"avatar_url":"https://avatars.githubusercontent.com/u/12016412?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenmilton58","html_url":"https://github.com/stevenmilton58","followers_url":"https://api.github.com/users/stevenmilton58/followers","following_url":"https://api.github.com/users/stevenmilton58/following{/other_user}","gists_url":"https://api.github.com/users/stevenmilton58/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenmilton58/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenmilton58/subscriptions","organizations_url":"https://api.github.com/users/stevenmilton58/orgs","repos_url":"https://api.github.com/users/stevenmilton58/repos","events_url":"https://api.github.com/users/stevenmilton58/events{/privacy}","received_events_url":"https://api.github.com/users/stevenmilton58/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-21T07:13:59Z","updated_at":"2015-06-27T07:58:14Z","closed_at":null,"body":"Rails 4.2.2, Devise 3.5.1, Warden 1.2.3\r\n\r\n**Note**: If  I revert the changes made in this pull request, things work as expected: https://github.com/plataformatec/devise/pull/3452/files\r\n\r\n**Description**\r\nI have an Admin model and am trying to use it to authenticate access to Sidekiq with Devise's \"authenticate\" method in Rails routes.\r\n\r\nroutes.rb :\r\n\r\n    devise_for :admins\r\n\r\n    authenticate :admin do\r\n      require 'sidekiq/web'\r\n      mount Sidekiq::Web => \"/admin/sidekiq\"\r\n    end\r\n\r\nI get a \"redirect loop\" error.\r\n\r\nUpon visiting `http://localhost:3000/admin/sidekiq` I get redirected to \r\n`http://localhost:3000/admin/sidekiq/admins/sign_in` instead of being redirected\r\nto `http://localhost:3000/admins/sign_in`.\r\n\r\nNot sure how to fix this.\r\n\r\nI see that the route being generated in `def scope_url` in failure_app.rb (https://github.com/plataformatec/devise/blob/master/lib/devise/failure_app.rb#L129)\r\nis `http://localhost:3000/admin/sidekiq/admins/sign_in` instead of the expected\r\n`http://localhost:3000/admins/sign_in`.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/plataformatec/devise/issues/comments/115980363","html_url":"https://github.com/plataformatec/devise/issues/3643#issuecomment-115980363","issue_url":"https://api.github.com/repos/plataformatec/devise/issues/3643","id":115980363,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T07:58:14Z","updated_at":"2015-06-27T07:58:14Z","body":"Can someone please send a pull request? Apparently we will need to detect the Rails version because the fix is required for Rails 4.2."}}