David Kimura PRO said almost 7 years ago on Rails API - Authentication with JWT :

That does appear to be a devise error message. If I had to guess, your controller/action that is redirecting/responding you to that error message is not inheriting from the Api::ApplicationController.