Remove session controller actions other than delete

and do some general cleanup around sessions controllers and the
sign_in_as test helper
This commit is contained in:
Mike Dalessio
2025-07-02 14:33:33 -04:00
parent c8be7418c1
commit fa1c5f7279
9 changed files with 18 additions and 100 deletions
+1 -23
View File
@@ -1,28 +1,6 @@
class SessionsController < ApplicationController
require_unauthenticated_access only: %i[ new create ]
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_path, alert: "Try again later." }
before_action :require_first_run_completion
def new
end
def create
if user = User.active.authenticate_by(params.permit(:email_address, :password))
start_new_session_for user
redirect_to after_authentication_url
else
redirect_to new_session_path, alert: "Try another email address or password."
end
end
def destroy
terminate_session
redirect_to new_session_path
redirect_to Launchpad.login_url, allow_other_host: true
end
private
def require_first_run_completion
redirect_to first_run_path if Account.none?
end
end