Fix check for authenticated user (refs #278)