Strapi 4: SuperAdmin Plugin Request 401

System Information
  • Strapi Version: 4.1.8
  • Operating System: Big Sur (M1)
  • Database: Sqlite
  • Node Version: v14.19.1
  • NPM Version: v6.14.16

Using the Strapi CLI to generate a plugin, and using the provided axiosInstance(1) (which attaches logged in SuperAdmin token) results in 401 errors when accessing REST api for a collection (/api/foo):

“data”: null,
“error”: {
“status”: 401,
“name”: “UnauthorizedError”,
“message”: “Missing or invalid credentials”,
“details”: {}

  1. src/plugins/my-new-plugin/admin/src/utils/axiosInstance.js

I’ve also tried adding the SuperAdmin token in the Swagger UI (Documentation plugin) and get the same result.

Does anyone know whats required to get this working?