Fix retrieval of tenant id after successful login