今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Implementing JWTs on the front end
- [Instructor] Okay. So we've created two routes on our backend now for allowing users to create an account and log in with the credentials that they've specified. So now that we have that logic available to us on the backend, it's time to add logic on the front end to integrate JWTs. Now, one way that we could do this would be to simply add that logic directly to our login page and sign up page. But one are the nice things that React allows us to do via hooks is define this logic once, and then simply import it into both our signup and login pages and use it there. You'll see what I mean in just a minute. So the basic idea of what we're going to do here is this. When a user clicks signup, or login, on our respective pages that we have here, both those pages are going to make a request to the corresponding route on the backend, which as we've seen will return a JSON web token containing the user's data. And then what…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
What is user authentication?6 分钟 27 秒
-
(已锁定)
Basic project setup6 分钟 28 秒
-
(已锁定)
Building a login page8 分钟 54 秒
-
(已锁定)
Building a sign-up page4 分钟 36 秒
-
(已锁定)
Creating private React routes4 分钟 11 秒
-
JSON Web Token basics9 分钟 22 秒
-
(已锁定)
Adding a sign-up route to the server8 分钟 10 秒
-
(已锁定)
Generating JSON Web Tokens6 分钟 10 秒
-
(已锁定)
Adding a login route to the server6 分钟 59 秒
-
(已锁定)
Implementing JWTs on the front end7 分钟 36 秒
-
(已锁定)
Adding JWTs to sign-up page4 分钟 29 秒
-
(已锁定)
Adding JWTs to login page2 分钟 11 秒
-
(已锁定)
Adding an update user route6 分钟 22 秒
-
(已锁定)
Verifying JSON Web Tokens5 分钟 17 秒
-
(已锁定)
Adding JWTs to the user info page7 分钟 29 秒
-
(已锁定)
Adding logout functionality1 分钟 33 秒
-
-
-
-
-
-
-