Added Rubocop and initial config

This commit is contained in:
2025-07-10 15:30:00 +03:00
parent 864769e70a
commit 42d45853ff
8 changed files with 140 additions and 35 deletions
+9 -6
View File
@@ -1,16 +1,19 @@
class SessionsController < ApplicationController
allow_unauthenticated_access only: %i[ new create ]
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." }
# frozen_string_literal: true
def new
end
class SessionsController < ApplicationController
allow_unauthenticated_access only: %i[new create]
rate_limit to: 10, within: 3.minutes, only: :create, with: lambda {
redirect_to new_session_url, alert: 'Try again later.'
}
def new; end
def create
if user = User.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."
redirect_to new_session_path, alert: 'Try another email address or password.'
end
end