Course lesson
Fetch Protected Data from a Resource Server with an Access Token
We're going to fetch a user with that token we exchanged the code parameter for in the previous lesson.
- Duration
- 1 min
- Access
- Pro
- Transcript
- Available
We're going to fetch a user with that token we exchanged the code parameter for in the previous lesson.
All we have to do is make a fetch request to the /user endpoint with an Authorization header that contains the token and then return the data. Like this Authorization: `Bearer ${token}