[BUGFIX] test loginUser before frontendUserRepository

Prevent a PHP warning if $GLOBALS['TSFE']->fe_user->user is not set