lib/authlogic_rpx/session.rb in tardate-authlogic_rpx-1.0.0 vs lib/authlogic_rpx/session.rb in tardate-authlogic_rpx-1.0.1
- old
+ new
@@ -165,11 +165,11 @@
# map_rpx_data maps additional fields from the RPX response into the user object
# override this in your session controller to change the field mapping
# see https://rpxnow.com/docs#profile_data for the definition of available attributes
#
def map_rpx_data
- self.attempted_record.email = @rpx_data['profile']['email'] if attempted_record.email.blank?
- self.attempted_record.username = @rpx_data['profile']['preferredUsername'] if attempted_record.username.blank?
+ self.attempted_record.send("#{klass.login_field}=", @rpx_data['profile']['preferredUsername'] ) if attempted_record.send(klass.login_field).blank?
+ self.attempted_record.send("#{klass.email_field}=", @rpx_data['profile']['email'] ) if attempted_record.send(klass.email_field).blank?
end
end
end
\ No newline at end of file