Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you change ActiveAdmin password?

I got ActiveAdmin running with [email protected]//password, but I want to change these credentials. Anyone know how to change them?

like image 826
kidcapital Avatar asked Nov 27 '11 06:11

kidcapital


2 Answers

Best way to do this would be to change it from the rails console :

    admin = AdminUser.find_by_email("[email protected]")
    admin.password = "newPassword"
    admin.save
like image 53
bpn Avatar answered Sep 24 '22 06:09

bpn


When you install ActiveAdmin using the generator, you'll find a migration called {timestamp}_devise_create_admin_users.rb in your db/migrate folder.

Find and change this line to whatever you want:

AdminUser.create!(:email => '[email protected]', :password => 'password', :password_confirmation => 'password')

Keep in mind though, that this is just the seed password, and is being exposed as plaintext. What you might want to do is set up the Devise controllers to have a password change action. Check out the wiki and the Railscast for help.

like image 22
Sudhir Jonathan Avatar answered Sep 21 '22 06:09

Sudhir Jonathan