Fix incorrect login/logout callback bug