JWT Authentication for React and FastAPI (easy with code)

  Рет қаралды 15,511

Eric Roby

Eric Roby

Күн бұрын

Пікірлер: 26
@yadavakash2609
@yadavakash2609 8 ай бұрын
This is called the perfect timing, I was struggling to authenticate user in protected pages. Thanks to you and your precise explaination, I got the answer.
@codingwithroby
@codingwithroby 8 ай бұрын
You're so welcome! Keep the grind going 🙂
@herozero777
@herozero777 4 ай бұрын
Very perfect timing for me too. A while back I got into React and FastAPI combo watching your tutorial and now this step was missing. Thanks for this man! Much Appreciated.
@codingwithroby
@codingwithroby 4 ай бұрын
Great to hear! Cheers!
@souzafelix
@souzafelix 8 ай бұрын
Nice video! I had just created a fastapi+react authentication routes and your example gave me ideas to refactor some parts
@codingwithroby
@codingwithroby 8 ай бұрын
That's great! Keep on coding 🙂
@1mrnewton
@1mrnewton 8 ай бұрын
Nice video! Can you share which vscode theme you use?
@codingwithroby
@codingwithroby 8 ай бұрын
One Dark Pro - it is an extension 🙂
@fooktu
@fooktu 8 ай бұрын
Overall great video! What is missing here is showing how to secure enpoints in the fastapi so that they are protected and how to make queries on the frontend to those enpoints (how to include token etc).
@codingwithroby
@codingwithroby 8 ай бұрын
Great suggestion! What you want to do is use a UserDependency on the BE and add Authorization: Bearer as a header on the FE.
@theverbalremedy
@theverbalremedy 5 ай бұрын
Hi ​@@codingwithroby..could you make a video on how to do this please as its such a common occurrence? Most FastAPI applications are not on localhost, they're often hosted (e.g. on EC2) where theyre exposed for anyone to access. Then a React app calls the endpoint. Can you show how you protect these FastAPI endpoints (eg with Tokens) and havr a React app call it?
@loupa6128
@loupa6128 8 ай бұрын
Nice video. If I have a lot of pages that only an authenticated user can access, do I need to place the code of `useEffect` in each component?
@codingwithroby
@codingwithroby 8 ай бұрын
Thanks! Yeah you do - another way is to have the component sit inside a parent and the parent redoes the useEffect each time
@losdel21
@losdel21 4 ай бұрын
CORS is not really for protecting the server, it is something implemented in the browser to avoid pages making cross-requests. You can download a plug-in for firefox to ignore CORS headers for example.
@codingwithroby
@codingwithroby 4 ай бұрын
Thanks for the additional context that can help others!
@aTr41n95
@aTr41n95 8 ай бұрын
Thank you so much. This video was perfect. A+++++++
@codingwithroby
@codingwithroby 8 ай бұрын
Glad you liked it! Woot !!
@Andromeda26_
@Andromeda26_ 7 ай бұрын
Great as always! It would be great too if you deploy them on Vercel or AWS.
@codingwithroby
@codingwithroby 7 ай бұрын
I have a vercel video on here - I have a full AWS deployment course coming soon!
@OpenDeepLearning
@OpenDeepLearning 8 ай бұрын
God bless you!
@codingwithroby
@codingwithroby 8 ай бұрын
I am glad you enjoy it 🙂
@Gelozo
@Gelozo 6 ай бұрын
ty!
@codingwithroby
@codingwithroby 6 ай бұрын
You bet!
@Ziv-dw3mn
@Ziv-dw3mn 8 ай бұрын
Great video, i would suggest stop using create react app and use vite instead (So much faster)
@codingwithroby
@codingwithroby 8 ай бұрын
Thanks for the tip! I just started looking into vite for my future videos 🙂
Deploy FastAPI on Vercel | Quick and Easy Tutorial
6:15
Eric Roby
Рет қаралды 14 М.
FastAPI JWT Tutorial | How to add User Authentication
20:27
Eric Roby
Рет қаралды 70 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Masterclass: AI-driven Development for Programmers
8:49
Fireship
Рет қаралды 1,1 МЛН
Linus On LLMs For Coding
17:06
ThePrimeTime
Рет қаралды 308 М.
Session Vs JWT: The Differences You May Not Know!
7:00
ByteByteGo
Рет қаралды 319 М.
API Authentication: JWT, OAuth2, and More
6:12
ByteMonk
Рет қаралды 24 М.
I Stopped Using Everything Else Once I Found Pydantic
13:45
Eric Roby
Рет қаралды 3,6 М.
Implementing JWT Authentication in ASP.NET Core
23:51
Nick Chapsas
Рет қаралды 49 М.
Reacting to Controversial Opinions of Software Engineers
9:18
Fireship
Рет қаралды 2,2 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.