Fixed undefined bug in auth code call