Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/casserver/authenticators/sql_encrypted.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ def generate_encryption_salt

def self.setup(options)
super(options)
user_model.__send__(:include, EncryptedPassword)
user_models.each { |auth_index, model| model.__send__(:include, EncryptedPassword) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should actually be:

user_model = user_models[options[:auth_index]]
user_model.__send__(:include, EncryptedPassword)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quick fix to make it work. :)
You, likely, right, so check it yourself, and make PR. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done just that. #226

end

def validate(credentials)
read_standard_credentials(credentials)
raise_if_not_configured

user_model = self.class.user_model
user_model = self.user_model

username_column = @options[:username_column] || "username"
encrypt_function = @options[:encrypt_function] || 'user.encrypted_password == Digest::SHA256.hexdigest("#{user.encryption_salt}::#{@password}")'
Expand Down