Browse Source

Remove leftover admin user code

pull/2524/head
Kat 2 years ago committed by kosiakkatrina
parent
commit
65ba50d4d5
  1. 6
      app/views/devise/sessions/new.html.erb
  2. 6
      config/initializers/rack_attack.rb
  3. 9
      spec/factories/admin_user.rb

6
app/views/devise/sessions/new.html.erb

@ -1,8 +1,4 @@
<% if resource_name == :admin_user %>
<% title = "Sign in to your CORE administration account" %>
<% else %>
<% title = "Sign in to your account to submit CORE data" %>
<% end %>
<% title = "Sign in to your account to submit CORE data" %>
<% content_for :title, title %>

6
config/initializers/rack_attack.rb

@ -17,12 +17,6 @@ Rack::Attack.throttle("password reset requests", limit: 5, period: 60.seconds) d
end
end
Rack::Attack.throttle("admin password reset requests", limit: 5, period: 60.seconds) do |request|
if request.params["admin_user"].present? && request.path == "/admin/password" && request.post?
request.params["admin_user"]["email"].to_s.downcase.gsub(/\s+/, "")
end
end
Rack::Attack.throttled_responder = lambda do |_env|
headers = {
"Location" => "/429",

9
spec/factories/admin_user.rb

@ -1,9 +0,0 @@
FactoryBot.define do
factory :admin_user do
sequence(:email) { |i| "admin#{i}@example.com" }
password { "pAssword1" }
phone { "07563867654" }
created_at { Time.zone.now }
updated_at { Time.zone.now }
end
end
Loading…
Cancel
Save