Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
CI / scan_ruby (push) Failing after 11m20s
CI / scan_js (push) Successful in 10m35s
CI / lint (push) Has been cancelled

Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 23:01:48 +02:00
co-authored by Cursor
commit c4e5f289cf
258 changed files with 11293 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
class SessionsController < ApplicationController
skip_before_action :require_login, only: %i[new create]
skip_before_action :set_current_project, only: %i[new create], raise: false
def new
redirect_to after_login_path if logged_in?
end
def create
user = User.active.find_by(email: params[:email].to_s.downcase.strip)
if user&.authenticate(params[:password])
login_as(user)
redirect_to after_login_path, notice: "Bentornato, #{user.first_name}!"
else
flash.now[:alert] = "Email o password non validi."
render :new, status: :unprocessable_entity
end
end
def destroy
logout
redirect_to login_path, notice: "Disconnesso correttamente."
end
private
def after_login_path
projects = if current_user.admin?
Project.active.ordered
else
current_user.accessible_projects
end
if projects.one?
project_root_path(project_code: projects.first.code)
elsif (code = session[:last_project_code]) && projects.exists?(code: code)
project_root_path(project_code: code)
else
root_path
end
end
end