Aggiunge gestione account con cambio password su web e app.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-08 10:38:57 +02:00
co-authored by Cursor
parent b8694a6b7b
commit 83a804a709
46 changed files with 1591 additions and 34 deletions
@@ -0,0 +1,39 @@
module Public
class AccountsController < WebBaseController
before_action :require_login!
def show
end
def update
name = params[:name].to_s.strip
if name.blank?
flash.now[:alert] = t("flash.accounts.name_required")
return render :show, status: :unprocessable_entity
end
if current_user.update(name: name)
redirect_to public_account_path, notice: t("flash.accounts.profile_updated")
else
flash.now[:alert] = current_user.errors.full_messages.to_sentence
render :show, status: :unprocessable_entity
end
end
def update_password
result = Users::ChangePassword.call(
user: current_user,
current_password: params[:current_password],
password: params[:password],
password_confirmation: params[:password_confirmation]
)
unless result.ok?
flash.now[:alert] = t("flash.accounts.password_#{result.error}")
return render :show, status: :unprocessable_entity
end
redirect_to public_account_path, notice: t("flash.accounts.password_updated")
end
end
end