The devise-api gem is a convenient way to add authentication to your Ruby on Rails application using the devise gem. It provides support for access tokens and refresh tokens, which allow you to authenticate API requests and keep the user's session active for a longer period of time on the client side
What
This error occurs when you try to login
Why
Because the
resource_owner_id
is null and database migration hasnull: false
Additional Info
This is what happens if I remove the
null: false
from the migrationNeed to know what in Rails 7 resource_owner_id is coming as null. The Users table is "users" the standard table.
route.rb
User Model
The API response I get after login
However in the database "resource_owner_id" is null (if I remove not null in the migration)