correctly check if user is logged in [Fixes #75879372 and #75881414]