title: Changing URL for devise_token_auth sign_in
body: <p>I use devise_token_auth and trying to change the users sign_in URL. I have sessions_controller in my <code>api/v2/</code> folder and <strong>devise_token_auth</strong> routes as below:</p>
  
  <p><strong>Routes:</strong></p>
  
  <pre><code>namespace :api do
      namespace :v2 do
          mount_devise_token_auth_for 'User', at: 'users', :controllers =&gt; {
            :registrations =&gt; 'api/v2/registrations',
            :confirmations =&gt; 'api/v2/confirmations',
            :passwords =&gt; 'api/v2/passwords',
            :sessions =&gt; 'api/v2/sessions'}
  
          post 'users/sign-in', to: 'sessions#create'
      end
  end
  </code></pre>
  
  <p>When I do <code>rake routes</code> I get <strong>the route</strong> as I wish:</p>
  
  <p><code>api_v2_users_sign_in  POST  /api/v2/users/sign-in(.:format)  api/v2/sessions#create</code></p>
  
  <p>but, when I try to hit the URL I get the following <strong>error:</strong></p>
  
  <pre><code>AbstractController::ActionNotFound (Could not find devise mapping for path "/api/v2/users/sign-in".
  This may happen for two reasons:
  
  1) You forgot to wrap your route inside the scope block. For example:
  
    devise_scope :user do
      get "/some/route" =&gt; "some_devise_controller"
    end
  
  2) You are testing a Devise controller bypassing the router.
     If so, you can explicitly tell Devise which mapping to use:
  
     @request.env["devise.mapping"] = Devise.mappings[:user]
  
  ):
  
  /Users/gokul/.rvm/gems/ruby-2.3.0@rails5.0/bundler/gems/devise-bcdd54cc5ebd/app/controllers/devise_controller.rb:88:in `unknown_action!'
  /Users/gokul/.rvm/gems/ruby-2.3.0@rails5.0/bundler/gems/devise-bcdd54cc5ebd/app/controllers/devise_controller.rb:63:in `assert_is_devise_resource!'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:382:in `block in make_lambda'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:169:in `block (2 levels) in halting'
  actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:12:in `block (2 levels) in &lt;module:Callbacks&gt;'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:170:in `block in halting'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:454:in `block in call'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:454:in `each'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:454:in `call'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:101:in `__run_callbacks__'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:90:in `run_callbacks'
  actionpack (5.0.0.rc1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (5.0.0.rc1) lib/action_controller/metal/rescue.rb:31:in `process_action'
  actionpack (5.0.0.rc1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (5.0.0.rc1) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (5.0.0.rc1) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
  activesupport (5.0.0.rc1) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (5.0.0.rc1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (5.0.0.rc1) lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
  activerecord (5.0.0.rc1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (5.0.0.rc1) lib/abstract_controller/base.rb:126:in `process'
  actionpack (5.0.0.rc1) lib/action_controller/metal.rb:190:in `dispatch'
  actionpack (5.0.0.rc1) lib/action_controller/metal.rb:262:in `dispatch'
  actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
  actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:32:in `serve'
  actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:39:in `block in serve'
  actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:26:in `each'
  actionpack (5.0.0.rc1) lib/action_dispatch/journey/router.rb:26:in `serve'
  actionpack (5.0.0.rc1) lib/action_dispatch/routing/route_set.rb:725:in `call'
  apipie-rails (0.3.6) lib/apipie/static_dispatcher.rb:65:in `call'
  actionview (5.0.0.rc1) lib/action_view/digestor.rb:12:in `call'
  apipie-rails (0.3.6) lib/apipie/extractor/recorder.rb:132:in `call'
  warden (1.2.6) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.6) lib/warden/manager.rb:34:in `catch'
  warden (1.2.6) lib/warden/manager.rb:34:in `call'
  rack (2.0.0.rc1) lib/rack/etag.rb:25:in `call'
  rack (2.0.0.rc1) lib/rack/conditional_get.rb:38:in `call'
  rack (2.0.0.rc1) lib/rack/head.rb:12:in `call'
  activerecord (5.0.0.rc1) lib/active_record/migration.rb:552:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:97:in `__run_callbacks__'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
  activesupport (5.0.0.rc1) lib/active_support/callbacks.rb:90:in `run_callbacks'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/callbacks.rb:36:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
  railties (5.0.0.rc1) lib/rails/rack/logger.rb:36:in `call_app'
  railties (5.0.0.rc1) lib/rails/rack/logger.rb:24:in `block in call'
  activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:70:in `block in tagged'
  activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (5.0.0.rc1) lib/active_support/tagged_logging.rb:70:in `tagged'
  railties (5.0.0.rc1) lib/rails/rack/logger.rb:24:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/request_id.rb:24:in `call'
  rack (2.0.0.rc1) lib/rack/runtime.rb:22:in `call'
  activesupport (5.0.0.rc1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/executor.rb:12:in `call'
  actionpack (5.0.0.rc1) lib/action_dispatch/middleware/static.rb:136:in `call'
  rack (2.0.0.rc1) lib/rack/sendfile.rb:111:in `call'
  rack-cors (0.4.0) lib/rack/cors.rb:80:in `call'
  railties (5.0.0.rc1) lib/rails/engine.rb:522:in `call'
  puma (3.2.0) lib/puma/configuration.rb:227:in `call'
  puma (3.2.0) lib/puma/server.rb:561:in `handle_request'
  puma (3.2.0) lib/puma/server.rb:406:in `process_client'
  puma (3.2.0) lib/puma/server.rb:271:in `block in run'
  puma (3.2.0) lib/puma/thread_pool.rb:111:in `block in spawn_thread' 
  </code></pre>
  
  <p>I need the URL to be <code>api/v2/users/sign-in</code>. Please help me.</p>
  
  <p>Thanks..</p>