Add a workaround for profile deletion

This commit is contained in:
Ari Timonen 2020-04-19 04:20:46 +03:00
parent 2a21f70603
commit 68de617f0e

View file

@ -85,6 +85,13 @@ class ApplicationController < ActionController::Base
Time.zone = cuser.time_zone Time.zone = cuser.time_zone
cuser.update_attribute :lastvisit, Time.now.utc if cuser&.lastvisit < 2.minutes.ago.utc 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 if cuser.banned? Ban::TYPE_SITE
session[:user] = nil session[:user] = nil
@cuser = nil @cuser = nil