Fetch Protected Data from a Resource Server with an Access Token

Share this video with your friends

Send Tweet

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}