Fixup some login issues and add integration spec