New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Devise::LdapAdapter.get_ldap_param return nil when array passed #69
Comments
I think you're right. Do you mind preparing a test case and a fix for this? Let me know. If not, I'll get to it when I get the chance. In the meantime, adding this to an initializer should fix it:
If this doesn't address your issue, let me know and I'll poke around further. |
Thank you for reply. I also propose to change the behavior of ldap_param_value to always return array. It related to ldap nature that you can have several same params with different values and NET::LDAP::Entry always return array. This helps developers to keep in mind that they suddenly can get array of values.
If the get_ldap_param will always return array I can safely write:
I looked at this topic: http://stackoverflow.com/a/5684335/1111202 |
+1 on always returning an Array jsirex instead of a test you can always coerce to an array: |
I think I agree. If the LDAP entry exists, we should always return an array for consistencies sake. |
I have in ldap user with two 'mail' attribute
When I try to search it using get_ldap_param I get nil. When user has only one attribute all ok.
Here is a little test i wrote in irb:
irb(main):006:0> a = [1,2]
=> [1, 2]
irb(main):007:0> a = a.first if false
=> nil
irb(main):008:0> a
=> [1, 2]
The text was updated successfully, but these errors were encountered: