Fix auth invalidation logic