I wonder if you might have any insight into a strange error that we're getting.
We've been receiving occasional exceptions (a few per week) from our sessions controller where the result of sign_in is success but the user record is nil. Our create action is pretty standard:
def create
@user = authenticate(params)
sign_in(@user) do |status|
if status.success?
after_login_actions
redirect_back_or url_after_create
else
flash.now.alert = error_message
render :new, status: :unauthorized
end
end
end
after_login_actions is really simple but the first thing it does is call a method on @user, and this is where were getting the errors because @user is nil.
We don't have any custom sign in guards so we're a little confused about why sign_in is either succeeding for an empty user record or blanking it itself somehow.
Any suggestions on what might be causing this or steps to diagnose what's happening?
I wonder if you might have any insight into a strange error that we're getting.
We've been receiving occasional exceptions (a few per week) from our sessions controller where the result of
sign_inis success but the user record isnil. Ourcreateaction is pretty standard:after_login_actionsis really simple but the first thing it does is call a method on@user, and this is where were getting the errors because@userisnil.We don't have any custom sign in guards so we're a little confused about why
sign_inis either succeeding for an empty user record or blanking it itself somehow.Any suggestions on what might be causing this or steps to diagnose what's happening?