Full-Stack React Projects
上QQ阅读APP看书,第一时间看更新

Signing in

To be able to access the protected route, we will sign in using the credentials of the user created in the first example. To sign in, a POST request is sent at /auth/signin with the email and password in the request body. On successful sign-in, the server returns a signed JWT and user details. We will need this token to access the protected route for fetching a single user: