Added WPCOM authentication header to first request (#8110)
Added WPCOM authentication header to first request (#8110)

* Added WPCOM authentication header to first request

When hosted on a WPCOM private blog, the first request fetching the valid routes from the API must be authenticated. I fixed this by attaching the Authorization header along with the Bearer auth token we got.

Also, having an auth set when doing this request did not work. Removing the options.auth when uneccessary (i.e. no credentials given) worked.

* fix linting

0x80/gatsby,ChristopherBiscardi/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,mingaldrichgan/gatsby,0x80/gatsby,gatsbyjs/gatsby,gatsbyjs/gatsby,mingaldrichgan/gatsby,0x80/gatsby,mingaldrichgan/gatsby,gatsbyjs/gatsby,ChristopherBiscardi/gatsby,ChristopherBiscardi/gatsby,ChristopherBiscardi/gatsby