fix(chalice): fixed SSO (#2715)

This commit is contained in:
Kraiem Taha Yassine 2024-10-30 17:37:54 +01:00 committed by GitHub
parent 56ba1770f7
commit 9ce67efb26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,7 +101,7 @@ async def __process_assertion(request: Request, tenant_key=None) -> Response | d
role = {"name": existing["roleName"], "roleId": existing["roleId"]}
if role is None:
for r in role_names:
if r.lower() == existing["roleName"].lower():
if existing and r.lower() == existing["roleName"].lower():
role = {"roleId": existing["roleId"], "name": r}
else:
role = roles.get_role_by_name(tenant_id=t['tenantId'], name=r)