sorcery icon indicating copy to clipboard operation
sorcery copied to clipboard

Added support for `scope_for_authentication` method

Open iamdeuterium opened this issue 3 years ago • 1 comments

Example:

class User < ApplicationRecord
  authenticates_with_sorcery!

  def self.scope_for_authentication
    where(deleted: false)
  end
end

iamdeuterium avatar Jun 30 '22 09:06 iamdeuterium

Until this pull request is merged, there is a workaround:

config/initializers/sorcery.rb

Rails.application.config.sorcery.configure do |config|
  #  :
  #  :
  config.user_class = 'ActiveUser'
  #  :
  #  :
end

app/models/active_user.rb

ActiveUser = User.where(deleted: false)

KitaitiMakoto avatar Dec 30 '24 19:12 KitaitiMakoto