Robbie Done
Robbie Done

Reputation: 1157

stopping the sign up option into devise

How can I stop just anyone signing up to my application rails admin using devise?

Currently when someone goes to my domain /admin they get the opportunity to sign up.

I have all the users i need and i don't want Joe Public to be able to gain access to the backend.

it may be as simple as to change the routes?

Upvotes: 2

Views: 242

Answers (2)

David Sulc
David Sulc

Reputation: 25994

Remove the :registerable flag from the User class. (Assuming the User class is you Devise class, of course.)

Upvotes: 6

Emily
Emily

Reputation: 18193

Take a look at your devise model, and you should see something like this:

class User < ActiveRecord::Base
  devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
end

The devise line is setting up which devise functionality will be included in your application. Remove the :registerable symbol and signup will no longer be an option.

Upvotes: 2

Related Questions