Merge pull request #12819 from athoik/dev

fix: Properly handle ldap3.abstract.attribute.Attribute value
This commit is contained in:
Tim Jaeryang Baek 2025-04-13 14:09:56 -07:00 committed by GitHub
commit 370f934158
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -230,7 +230,7 @@ async def ldap_auth(request: Request, response: Response, form_data: LdapForm):
entry = connection_app.entries[0]
username = str(entry[f"{LDAP_ATTRIBUTE_FOR_USERNAME}"]).lower()
email = entry[f"{LDAP_ATTRIBUTE_FOR_MAIL}"]
email = entry[f"{LDAP_ATTRIBUTE_FOR_MAIL}"].value # retrive the Attribute value
if not email:
raise HTTPException(400, "User does not have a valid email address.")
elif isinstance(email, str):