I have configured the user authentication of a Rails API with both devise and jwt. Only the email and the password of the user is required for the user to either signup or login. Because this is an API, prevention against cross-site request forgery is not required, so the application_controller.rb file includes the line protect_from_forgery with: :null_session.
This implementation allows me to signup users (and I can see them all listed when I query "User.all" in the rails console) and to obtain a bearer token. However, when I try to login that same user, by inputting his/her email and password and including the bearer token, the result that I obtain is : "Can't verify CSRF token authenticity. Completed 401 Unauthorized".
I have already tried placing the line skip_before_action :verify_authenticity_token at the top of the sessions_controller.rb to no avail.
I do not know if this is relevant but, I have use this very same implementation for authentication before in Rails apps with a Postgres database and have always had success with them, here I am using a MySQL database for the first time and have encountered several novel problems - the one here described being the most intractable.
What is going on, and how can I solve this? Thank you in advance for any feedback.