Club come entità principale, branding e fix infrastruttura streaming.

Introduce clubs con abbonamento, branding Active Storage e flusso registrazione società; corregge healthcheck MediaMTX (immagine distroless) e allinea dominio produzione matchlivetv.it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-27 09:16:24 +02:00
parent 471291b2c4
commit 4083bc5dee
53 changed files with 1120 additions and 197 deletions

View File

@@ -1,14 +1,22 @@
module Public
class SessionsController < WebBaseController
def new
redirect_to public_team_dashboard_path(current_user.teams.first) if logged_in? && current_user.teams.any?
if logged_in? && current_user.primary_club
redirect_to public_club_path(current_user.primary_club)
end
end
def create
user = User.find_by(email: params[:email]&.downcase)
if user&.authenticate(params[:password])
session[:user_id] = user.id
dest = user.teams.first ? public_team_dashboard_path(user.teams.first) : new_public_team_path
dest = if user.primary_club
public_club_path(user.primary_club)
elsif user.manageable_teams.first
public_team_dashboard_path(user.manageable_teams.first)
else
public_new_club_path
end
redirect_to dest, notice: "Bentornato!"
else
flash.now[:alert] = "Email o password non validi"