From 68de617f0e55bf8f4db9a3d3f56e3e0cac1278c3 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sun, 19 Apr 2020 04:20:46 +0300 Subject: [PATCH] Add a workaround for profile deletion --- app/controllers/application_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4a05b69..55e251d 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -85,6 +85,13 @@ class ApplicationController < ActionController::Base Time.zone = cuser.time_zone cuser.update_attribute :lastvisit, Time.now.utc if cuser&.lastvisit < 2.minutes.ago.utc + # FIXME: there is a bug in steam auth that causes nil profile + unless cuser.profile&.present? + flash[:notice] = "Your profile has been removed and recreated." + cuser.build_profile + cuser.save + end + if cuser.banned? Ban::TYPE_SITE session[:user] = nil @cuser = nil