Files
once-campfire/app/controllers/users/profiles_controller.rb
T
Jeremy Daer c6e0105491 Close live connections from the model on any password change
The sessions end wherever the password changes, but only the profile
page closed the live connections, so a change from a console left a
signed-out device receiving messages until it dropped. Close them after
commit from User, logging rather than failing if the realtime service
can't be reached, since the password is saved by then.
2026-10-19 10:33:46 -07:00

27 lines
645 B
Ruby

class Users::ProfilesController < ApplicationController
before_action :set_user
def show
@direct_memberships, @shared_memberships =
Current.user.memberships.with_ordered_room.partition { |m| m.room.direct? }
end
def update
@user.update user_params
redirect_to user_profile_url, notice: update_notice
end
private
def set_user
@user = Current.user
end
def user_params
params.require(:user).permit(:name, :avatar, :email_address, :password, :bio).compact
end
def update_notice
params[:user][:avatar] ? "It may take up to 30 minutes to change everywhere." : "✓"
end
end