11 months agoby Praveen Kumar

Practice of Pingpong Authentication.

Dear Sir,

I am new in React Js and try to learn react js by your tutorial and facing issue. when setup Pingpong Authentication code on our machine localhost and submit the login form then getting an error. Error is:-

Unhandled Rejection (TypeError): Cannot read property 'data' of undefined (anonymous function) E:/xampp/htdocs/pingpong/src/Login.js:22 19 | cookie.set("user", res.data.user); 20 | this.props.history.push("/profile"); 21 | }) > 22 | .catch(e => this.setState({ errors: e.response.data})); | ^ 23 | }; 24 | 25 | handleInput = (e)=>{ View compiled This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error.


Praveen Kumar replied 11 months ago


Dear Sarthak Sir,

I have also getting new errors on this pingpong series, when submit the login form Error is:

Access to XMLHttpRequest at 'http://localhost:8000/api/auth/login' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

please help me asap.



Praveen Kumar replied 11 months ago


Thanks for your reply Sarthak sir. But I am also PHP, Laravel developer. it is a basic thing that laravel localhost server is start or not. In my case localhost:8000 is running and when register an user by register form then data is store in my pingpong DB on localhost DB server but on web browser screen gives error page which is post on my problem. and i got same error when submit the login form. Please suggest me what is i doing wrong.


Sarthak Shrivastava replied 11 months ago


You have not started laravel server, please check you have localhost:8000 working fine


Sarthak replied 11 months ago


Yes, this error comes only when token is invalid or expired and you refresh the page, I will handle this error in later episodes of this video

Ask Question
Most Visited