nejdetkadir / devise-api

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
MIT License
152 stars 22 forks source link

Incompatible with Mongoid ORM #39

Open merouaneamqor opened 6 months ago

merouaneamqor commented 6 months ago
Devise.setup do |config|
  config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
  require 'devise/orm/mongoid'
  config.case_insensitive_keys = [:email]
  config.strip_whitespace_keys = [:email]
  config.skip_session_storage = [:http_auth]
  config.reconfirmable = true
  config.expire_all_remember_me_on_sign_out = true
  config.responder.error_status = :unprocessable_entity
  config.responder.redirect_status = :see_other
end

ActiveRecord::ConnectionNotEstablished at /api/v1/users/tokens/sign_in

No connection pool for 'ActiveRecord::Base' found.

To access an interactive console with this error, point your browser to: /__better_errors

activerecord (7.0.8) lib/active_record/connection_adapters/abstract/connection_handler.rb, line 208

  203               message = "No connection pool for '#{spec_name}' found for the '#{role}' role."
  204             else
  205               message = "No connection pool for '#{spec_name}' found."
  206             end
  207   
> 208             raise ConnectionNotEstablished, message
  209           end
  210   
  211           pool.connection
  212         end
  213   

App backtrace

Full backtrace