Add auth in all controllers

This commit is contained in:
sto
2025-03-22 13:07:12 +01:00
parent 5472a400d1
commit 6b02eecb9b
11 changed files with 107 additions and 6 deletions

View File

@@ -3,9 +3,11 @@ class SessionsController < ApplicationController
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Try again later." }
def new
skip_authorization
end
def create
skip_authorization
if user = User.authenticate_by(params.permit(:email_address, :password))
start_new_session_for user
redirect_to after_authentication_url