Factor out broken auth code fom editor app