Authentication Implementation using Access & Refresh Tokens in React

preview_player
Показать описание
In this tutorial, I'm going to show how to automatically get JWT access token out of a refresh token and save it to the browser using localStorage

***Please try to make a pull request if it needs some changes***
Рекомендации по теме
Комментарии
Автор

your explanation is exactly what I was looking for, shared the files, you just nailed it man, cheers.

brunofilgueiras
Автор

Hi thank you for making this amazing course!
I just have a question.
I make a request to the login API and I receive the refresh token that is in the cookie and the access token that is in the response body. Now how should I handle the access token on the client side(next js)? If I store this in a global state like context API, then I don't have access to that state in the getServerSideProps function, and I can't set it in the request.header.authorization because getServerSideProps run on the server side and the state or local storage is on the client side!
what is the right flow for this kind of case?

Mike-xrfk
Автор

Hi, please what are the benefits to using this authentication method?

chinedueke
Автор

I would not refresh token constantly..

papastepano
Автор

It won't register new user... what should I put in request body?

heathen
Автор

thank you so much 👍👍🙌👏, please zoom the screen

mahendranath
Автор

there was no flow in this video its almost as if you copied and pasted everything in here

masonasa
Автор

You're not supposed to set jwt tokens in localstorage

YourModdedControllers