login: remove login reminder page.

Remove the login reminder page. The meaning of "login reminder" wasn't
clear (it's for recovering a forgotten username) and the functionality
was redundant. The password reset page can already be used to recover
forgotten usernames.

There was also a privacy leak, since the login reminder page could be
used to find out whether a given email is in use on Danbooru.
This commit is contained in:
evazion
2019-12-14 16:19:01 -06:00
parent 872bd28d42
commit efd1327f1e
8 changed files with 1 additions and 112 deletions

View File

@@ -1,20 +0,0 @@
module Maintenance
module User
class LoginRemindersController < ApplicationController
def new
end
def create
@user = ::User.with_email(params[:user][:email]).first
if @user
LoginReminderMailer.notice(@user).deliver_now
flash[:notice] = "Email sent"
else
flash[:notice] = "Email address not found"
end
redirect_to new_maintenance_user_login_reminder_path
end
end
end
end

View File

@@ -255,7 +255,7 @@ module ApplicationHelper
protected
def nav_link_match(controller, url)
url =~ case controller
when "sessions", "users", "maintenance/user/login_reminders", "maintenance/user/password_resets", "admin/users"
when "sessions", "users", "maintenance/user/password_resets", "admin/users"
/^\/(session|users)/
when "forum_posts"

View File

@@ -1,12 +0,0 @@
module Maintenance
module User
class LoginReminderMailer < ActionMailer::Base
def notice(user)
@user = user
if user.email.present?
mail(:to => user.email, :subject => "#{Danbooru.config.app_name} login reminder", :from => Danbooru.config.contact_email)
end
end
end
end
end

View File

@@ -1 +0,0 @@
<p>Your username is <%= @user.name %>.</p>

View File

@@ -1,24 +0,0 @@
<div id="c-maintenance-user-login-reminders">
<div id="a-new" class="fixed-width-container">
<h1>Login Reminder</h1>
<p>If you supplied an email address when signing up, <%= Danbooru.config.app_name %> can email you your login information. Password details will not be provided and will not be changed.</p>
<p>If you didn't supply a valid email address, you are out of luck.</p>
<%= form_tag(maintenance_user_login_reminder_path, :class => "simple_form") do %>
<div class="input email required">
<label for="user_email" class="required">Email</label>
<%= email_field(:user, :email) %>
</div>
<%= submit_tag "Submit" %>
<% end %>
</div>
</div>
<%= render "sessions/secondary_links" %>
<% content_for(:page_title) do %>
Login Reminder - <%= Danbooru.config.app_name %>
<% end %>