You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roc Khalil edited this page Nov 22, 2016
·
9 revisions
In config/initializers/rails_admin.rb, you can add the following lines of code:
config.authorize_with do
authenticate_or_request_with_http_basic('Login required') do |username, password|
user = User.where(email: username, password: password, admin: true).first
user
end
end
This will call your User object from the database and check if it exists,
If yes, it will login else it won't.