Auth Interceptor

Let's add an interceptor to authenticate users while making API requests.

We'll cover the following

The Create Event section within the API documentation shows the endpoint our application should aim for, along with the example request body and response. In addition to those is a section labeled “Example header.” This header contains an Authorization property with a value containing a JWT.

To create events, we’ll need to pass the JWT from localStorage with our request so that the API knows the request is coming from an authenticated user.

Get hands-on with 1200+ tech skills courses.