Q:

Remove admin registration route from rails-api devise_token_auth project?

I'm trying to prevent rails from exposing the devise_token_auth registration route so that admins can only be created from the console.
My admin.rb looks like this:
class Admin < ActiveRecord::Base
  devise :database_authenticatable, :confirmable,
         :recoverable, :trackable, :validatable,
         :omniauthable

  include DeviseTokenAuth::Concerns::User
end

I'm not sure what I should put in my config/routes.rb to prevent rails from exposing the route.

A:

Removing :registerable ,:omniauthable and :confirmable  from the model should do the trick.
Try adding this to your routes as well:
 mount_devise_token_auth for 'Admin', at: 'admin_auth', :skip => [:registrations] 

