How to Solve CORS error in a React app

preview_player
Показать описание
In this lesson we'll talk about a few important concepts.

1) We will address how to tackle the CORS (Cross Origin Resource Sharing) issue that comes up when you have a React app communicate with a Java RESTful API.
2) We'll talk about how to properly send a request from the React app to the Java Server with "application/json" headers.
3) How to grab our generated JWT token on the client side within the response headers.

Other Important Links:
---------------------------

#react #cors #jwt #springsecurity

00:00 Intro
00:45 Steps to create the CORS issue
11:27 How to Fix the CORS issue
Рекомендации по теме
Комментарии
Автор

This is the actual build from scratch tutorial series. Waiting for next step.. You are covering most important things that everyone should know when building something like this. No hidden things. Thank you

pathummadhusanka
Автор

2 years late, but thank you so much!! Went through a bunch of tutorials and none fixed the problem or were as exhaustive as this one. Really like this format where you go step by step and try different solutions, its very didactic and useful. Cheers!

SuperManuelrey
Автор

Removing localhost and added proxy in client side worked like a charm. Struggling from almost 2 days completely exhausted and this saved me big time thank you so much.

shivaprasad
Автор

I thoroughly enjoyed this video; the struggle with accessing the header values was calming. I'd like to understand why the login response returns the token in the header and not the response body?

chinenye_ikpa
Автор

you are a master, 140 hours trying to find a solution...

alexprogresivex
Автор

I love your videos about teaching full stack development. It makes me more comfortable that we developers have to google everything what we do not know :D

RlayerLP
Автор

Phew, I'm so glad I found your video on this topic.. You saved me!!

briancornine
Автор

thanks after 3hrs of searching 3 mins of your video where enough to get a response many many thanks

lucaletsplayt
Автор

Friend, thank you very much, greetings from Kazakhstan. Very useful video good luck to you

volselongames
Автор

I'm currently running react-email on my .NET React project. I enabled cors, added the headers in my api file, still getting the allow cross origins errors. So I found a piece of code to put in next.config.js to add the headers through there but then I'm getting the error saying it doesn't have HTTP Ok response. Already spent hours trying to fix but no result, do you have any idea?

Misterbobbie
Автор

Thank you for your videos, but please you don't have a video about a react js / spring boot project secured by keycloak

ibeipkm