今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Adding a sign-up route to the server
- [Instructor] Now that we know the basics behind what JSON Web Tokens are and how they work, it's time to start adding some routes to our server that'll incorporate JWTs as a way to allow us to sign up users and log them in. First thing we're going to add to our server is a sign up route. So let's open up our backend and src and routes here. That's where we'll be creating it. And this is the route that our server will send a request to when a new user signs up and what the route'll do is it's basically going to create a new user in our database and send back a JSON Web Token containing the user's data. We'll see a little later on exactly how this is actually stored and used by the front end but for now, here's what it's going to look like. Let's start off by creating a new file for our route. And we'll just call it signUpRoute.js. And just like we defined our testRoute using this object, we're going to use the same…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
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 秒
-
-
-
-
-
-
-